搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Webextension run_at in manifest.json not working correctly

  • 1 回覆
  • 2 有這個問題
  • 2 次檢視
  • 最近回覆由 Paul

more options

You can define to load a page at a certain time of building DOM using run_at: for example with parameter page_start. this isn't working either. it seems to me that either the script is being run asynchronous, or there is some other reason for this not to be working: aall=document.getElementsByTagName("*"); for (var i=0, max=aall.length; i < max; i++) { aall.addEventListener=function(a,b,c){ console.log("Log"); return false; }; } console.log("Log"); is never being called, even though an event has been added to the element using addEventListener. My current solution for this is an own firefox fork that overwrites the functions in the javascript engine, which is kind of overdosed.

You can define to load a page at a certain time of building DOM using run_at: for example with parameter page_start. this isn't working either. it seems to me that either the script is being run asynchronous, or there is some other reason for this not to be working: aall=document.getElementsByTagName("*"); for (var i=0, max=aall.length; i < max; i++) { aall.addEventListener=function(a,b,c){ console.log("Log"); return false; }; } console.log("Log"); is never being called, even though an event has been added to the element using addEventListener. My current solution for this is an own firefox fork that overwrites the functions in the javascript engine, which is kind of overdosed.

被選擇的解決方法

Hi

if you have a question about add-on development, I recommend you ask in the main add-on forums at https://discourse.mozilla.org/c/add-ons.

從原來的回覆中察看解決方案 👍 0

所有回覆 (1)

more options

選擇的解決方法

Hi

if you have a question about add-on development, I recommend you ask in the main add-on forums at https://discourse.mozilla.org/c/add-ons.