English 中文(简体)
• 如何使用网页改造,以修改由 Java本装载的内容
原标题:How to use page-mod to modify element loaded by JavaScript

I m 创建火ox添加剂,在具体 but子中添加立克事件。 (“投入”部分)

The button is placed in http://example.com/welcome#_pg=compose but when I open the page, following error occures:

类型:文件.querySelector(“#send_top”)无效

#send_top is id of the button which I want to modify. So, the button is not found.

This error occurs because http://example.com/welcome and http://example.com/welcome#_pg=compose is completely different pages. In this case, the addon seems loading http://example.com/welcome but there is no button whose #send_top ID. When #_pg=compose anchor is added, the button is loaded by JavaScript.

• http://example.com/welcome#_pg=compose”rel=“nofollow” 修改纽伦?

最佳回答

Three thoughts to help you debug this:

  1. 为了正确匹配你应考虑使用定期表述而不是页面-格式的辛醇,这可能使你能够以更可预测的方式对 anchor作出反应。

  2. 我发现,在使用内容文字时,如果经过联合材料大量修改,你可以处理时间问题。 粗体工作或许是寻找你想要的成分,如果是的话,则为100毫米秒钟左右,然后重新检查。 举例来说,“是”,但“我”在使用新的“前线”时使用。

  3. You can use the unsafeWindow variable in your content script to directly access the page s window object - this object will contain any changes JS has made to the page and is not proxied. You should use unsafeWindow with great caution however as its use represent a possible security problem. In particular, you should never trust any data coming from unsafeWindow, ever.

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签