Discussões » Desenvolvimento

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

§
Publicado em: 12/01/2017

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
§
Publicado em: 12/01/2017

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.

Enviar resposta

Entre para publicar uma resposta.

长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元