diff --git a/background.js b/background.js index 87dfa3e..0c7c03f 100644 --- a/background.js +++ b/background.js @@ -77,6 +77,18 @@ browser.contextMenus.create({ contexts: ["all"] }); +browser.contextMenus.create({ + id: "my-scuttle", + title: "My (Semantic)Scuttle", + onclick: function(){ + browser.storage.local.get(["instance_url","username"],function(item){ + myurl = item["instance_url"] + "/bookmarks.php/" + item["username"]; + var creating = browser.tabs.create({url: myurl}); + }) + }, + contexts: ["all"] +}); + browser.browserAction.onClicked.addListener((tab) => { if((tab.url.includes("about:reader?url=") == true) || (tab.url.includes("https://addons.mozilla.org/") == true)){ shareURL("",tab); diff --git a/manifest.json b/manifest.json index 2ca8a0b..b6b1997 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version" : 2, "name": "Add to (Semantic)Scuttle", - "version" : "0.8", + "version" : "0.9", "description" : "Add bookmarks to a (Semantic)Scuttle instance, a social bookmarking tool experimenting with tags and collaborative tag descriptions.", "homepage_url" : "https://addons.mozilla.org/fr/firefox/addon/add-to-semantic-scuttle/", "icons" : { diff --git a/options.html b/options.html index 06ca612..64e2d1e 100644 --- a/options.html +++ b/options.html @@ -9,6 +9,7 @@

+



diff --git a/options.js b/options.js index b35c1a8..b5ca58a 100644 --- a/options.js +++ b/options.js @@ -2,6 +2,7 @@ function saveOptions(e) { e.preventDefault(); browser.storage.local.set({ instance_url: document.querySelector("#instance_url").value , + username: document.querySelector("#username").value , window_width: document.querySelector("#window_width").value , window_height: document.querySelector("#window_height").value, remove_querystrings: document.querySelector("#remove_querystrings").checked, @@ -13,6 +14,7 @@ function restoreOptions() { function setCurrentChoices(result) { document.querySelector("#instance_url").value = result["instance_url"] || "http://semanticscuttle.sourceforge.net/"; + document.querySelector("#username").value = result["username"] || "Me"; document.querySelector("#window_width").value = result["window_width"] || "640"; document.querySelector("#window_height").value = result["window_height"] || "480"; document.querySelector("#remove_querystrings").checked = result["remove_querystrings"] || false; @@ -23,7 +25,7 @@ function restoreOptions() { console.log(`Error: ${error}`); } - var getting = browser.storage.local.get(["instance_url","window_width","window_height","remove_querystrings","exceptUrlList"]); + var getting = browser.storage.local.get(["instance_url","username","window_width","window_height","remove_querystrings","exceptUrlList"]); getting.then(setCurrentChoices, onError); }