I have an issue with onclick browser action. All the time it shows TypeError: browser is not defined if i do put in try catch Tried manually inseritng into firefox console, no success still not defined. Using firefox 55. How to overcome the issue?
console.log("Start 1")
function run(){console.log(1)}
browser.browserAction.onClicked.addListener(run);
var interval1Id = setInterval(function(){
var id = document.querySelector(".myclass").id
document.getElementById('m1).contentWindow.document.getElementById(id).click();
var newDate = new Date();
console.log("Function executes at : " +newDate )
},10000);
Manifest
{
"applications": {
"gecko": {
"id": "at@ex.com",
"strict_min_version": "52.0"
}
},
"browser_action": {
"default_icon": {
"18": "icons/btn18.png",
"38": "icons/btn18.png"
},
"default_title": "Whereami1?"
},
"manifest_version": 2,
"name": "FF 1a",
"version": "1a",
"description": "Refresh",
"background": {
"scripts": ["b.js"]
},
"content_scripts": [
{
"matches" : ["https://*/*"],
"js": ["scr.js"]
}
],
"permissions": ["webNavigation","tabs","notifications","activeTab"],
"web_accessible_resources": ["icons/btn18.png"]
}