From b127e1e9f9e47e95ad197fdce410455a94c50421 Mon Sep 17 00:00:00 2001 From: Laurent Espitallier Date: Sat, 22 Jul 2017 21:57:50 +0200 Subject: [PATCH] Atteimpt to correct the bug on first click --- background.js | 7 ++++++- manifest.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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" : {