简体   繁体   中英

Manifest.json file not working properly in javascript?

i have a chrome extension for creating a button in Gmail webpage.

the button was created successfully in on that page.but after refreshing that page,the button was not created.it gives aa class undefined.

after clearing the cache and cookies,it works.but not all time,sometimes only.

my manifest.json file code here:

{
  "manifest_version": 2,

  "name": "E-mail Security",
  "description": "This extension demonstrates a Email security ",
  "version": "1.0",

  "browser_action": {
    "default_icon": "icon.png",
    "default_popup": "popup.html"
  },
  "permissions": [ "notifications", "contentSettings", "cookies", "tabs", "contextMenus", "http://*/*", "https://*/*" ],

  "content_scripts": [
    {     

    "matches": ["http://*/*", "https://*/*"],
      "js": ["ngContent.js","jquery.js"]

    }
]

}

why,that above problem was occured.whether i miss something in manifest.json file?

note:i am using chrome browser.

Create the button when the page loads. Then perhaps define an event for MutationObserver. Every time the button disappears, your code should get triggered to create it once again. Then apply whatever other rules/actions you want to for that button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM