Skip to content

Instantly share code, notes, and snippets.

@dharmesh-hemaram
Last active March 21, 2023 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dharmesh-hemaram/78b73be30ba5a45067c7250948778b46 to your computer and use it in GitHub Desktop.
Save dharmesh-hemaram/78b73be30ba5a45067c7250948778b46 to your computer and use it in GitHub Desktop.
Open link in new tab

Open link in new tab

This script explain how we can open link of site in new tab. It works on <a href> elements only with href attribute having link to open page.

For example we will try on https://yari-demos.prod.mdn.mozit.cloud/en-US/docs/Web/HTML/Element/a/_sample_.Linking_to_an_absolute_URL.html

To open link in new tab it must have target="_blank" as attribute within <a> element

<a href="abc.com" target="_blank">Link</a> If a link dont have target="_blank" attribute on it you can add this through extension. Before clicking that link you need two action.

Action 1 to set attribute target to link Element Finder - //a or specific xpath of link Value - Attr::set::target::_blank Action 2 to click on link Element Finder - link xpath or element finder

How to use

  • Download configuration.json below
  • Import into below extension
  • Refresh Page

Auto Clicker Auto Fill Extension


tags

#openlink #openlinknewtab #autoclickerextension #autoclicker #autofill

{
"name": "a-new-tab",
"url": "https://yari-demos.prod.mdn.mozit.cloud/en-US/docs/Web/HTML/Element/a/_sample_.Linking_to_an_absolute_URL.html",
"initWait": 0,
"startTime": "",
"enable": true,
"startType": "auto",
"loadType": "window",
"hotkey": "Ctrl + Shift + A",
"batch": {
"refresh": false,
"repeat": 0,
"repeatInterval": 0
},
"actions": [
{
"name": "",
"initWait": 0,
"elementFinder": "//a",
"value": "Attr::set::target::_blank",
"repeat": 0,
"repeatInterval": 0,
"addon": {
"elementFinder": "",
"value": "",
"condition": "",
"valueExtractor": "",
"recheck": 0,
"recheckInterval": 0,
"recheckOption": "stop"
}
},
{
"name": "",
"initWait": 0,
"elementFinder": "//a",
"value": "",
"repeat": 0,
"repeatInterval": 0,
"addon": {
"elementFinder": "",
"value": "",
"condition": "",
"valueExtractor": "",
"recheck": 0,
"recheckInterval": 0,
"recheckOption": "stop"
},
"focus": true
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment