diff --git a/background.js b/background.js index 864f602..a0d81f7 100644 --- a/background.js +++ b/background.js @@ -2,11 +2,16 @@ var instance var windowWidth var windowHeight +// prefs are not loaded once before shareURL it won't work on first click. +var gettingPrefs = browser.storage.local.get(["instance_url","window_width","window_height"]); +gettingPrefs.then(onGot,onError); + function shareURL(){ browser.tabs.query({active: true},function(tabs){ + // prefs are loaded again when the function is called to manage changes in the options page. let gettingPrefs = browser.storage.local.get(["instance_url","window_width","window_height"]); - gettingPrefs.then(onGot, onError); + gettingPrefs.then(onGot,onError); var tab = tabs[0]; diff --git a/manifest.json b/manifest.json index 2101f0b..f08e01d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version" : 2, "name": "Add to (Semantic)Scuttle", - "version" : "0.4", + "version" : "0.5", "description" : "Add bookmarks to a (Semantic)Scuttle instance, a social bookmarking tool experimenting with tags and collaborative tag descriptions.", "homepage_url" : "https://github.com/FrenchHope/Add-to-Semantic-Scuttle-WebExt", "icons" : {