Greasy Fork is available in English.

議論 » 開発

Going crazy trying to add attribute target to link on webpage.

§
投稿日: 2017/01/12

Going crazy trying to add attribute target to link on webpage.

Hey there, thanks for taking the time to read.

I'm going crazy trying to add attribute "target" to link ("a.gr-button") on the web page. I'm working on the site https://www.goodreads.com/giveaway I want to make the web page that opens when I click "Enter Giveaway" to open in a new window/tab.

I've searched through http://www.w3schools.com/ multiple times and can't get any of the examples to work. I must be missing something here. Any suggestions would be greatly appreciated.

woxxomMod
§
投稿日: 2017/01/12

The page is dynamically constructed by its javascript code as you can see in devtools (F12) - network panel - click on the first "document" request and see Preview tab. This means that the final document is constructed after userscripts were executed (that is after DOMContentLoaded).

The simplest solution is to use waitForKeyElements which is based on setTimeout.

返信を投稿

返信を投稿するにはログインしてください。