Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

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

  • 6 trả lời
  • 2 gặp vấn đề này
  • 36 lượt xem
  • Trả lời mới nhất được viết bởi 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.

Đính kèm ảnh chụp màn hình

Tất cả các câu trả lời (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.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.