搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

After refreshing my extension is not loading, whta i have to do to auto reload?

  • 6 个回答
  • 2 人有此问题
  • 1 次查看
  • 最后回复者为 vishal2

more options

I have created a extension for Gmail. I added that to firefox and the extesion has aded but the problem is after refreshing or reopening i have reload extension also otherwise it won't work, what is the problem? i have attached 2 images that is one before reloading the extension and 2nd is after reloading the extension.

I have created a extension for Gmail. I added that to firefox and the extesion has aded but the problem is after refreshing or reopening i have reload extension also otherwise it won't work, what is the problem? i have attached 2 images that is one before reloading the extension and 2nd is after reloading the extension.
已附加屏幕截图

所有回复 (6)

more options

My complete guess is that you're not hooking into the page load correctly, or that you're looking for the load, but need to actually look for when the element is inserted into the DOM.

However, without knowing your code, it is very hard to know for sure.

If you can't figure it out, I suggest you hop over to our dedicated add-ons support https://discourse.mozilla.org/c/add-ons and discuss there. You might also want to share a couple of code snippets for what you're doing for the insertion routines.

more options

This is my code, i'm appending a button in gmail input box, button is appending but i have to reload extension each and every time. Please help me to solve this.

var btn = document.createElement("BUTTON");
btn.setAttribute("id","button");

btn.innerHTML = "BUTTON"; btn.setAttribute("style","background-color:rgb(65, 192, 4);font-size:1.0em;width:95px;height:35px;border-color:rgb(65, 192, 4);color:white;border-radius: 5px;grid-row:1.7em;margin-left:5px"); //document.body.appendChild(btn); document.getElementById(':me').appendChild(btn);

more options

As I mentioned before, it depends on how you're triggering that code to be called, not necessarily the code itself. You need to make sure it is triggered on page/document load, as well as when you load the add-on.

The community on discourse is in a much better position to help you here.

more options

how to trigger that code when page is refreshed? can you please help me with that

more options

Sorry, I don't know enough about those parts of the WebExtensions to help you with that. I'm guessing based on what you've reported.

Please ask the community at https://discourse.mozilla.org/c/add-ons. You might also be able to get help from them on IRC in the #webextensions channel.

more options

Thank you.