Init Firefox plugin
Anirudh Oppiliappan x@icyphox.sh
Thu, 16 Sep 2021 18:40:12 +0530
3 files changed,
35 insertions(+),
0 deletions(-)
A
forlater.js
@@ -0,0 +1,16 @@
+function saveForLater(tab) { + const tabURL = tab.url + const mailto = `mailto:save@forlater.email?&body=${tabURL}` + browser.tabs.update({ + url: mailto, + }) +} + +browser.browserAction.onClicked.addListener(saveForLater) +browser.contextMenus.create({ + 'title': "Send page to forlater", + 'contexts': ['all'], + 'onclick': function(info, tab) { + saveForLater(tab); + } +});
A
manifest.json
@@ -0,0 +1,19 @@
+{ + "manifest_version": 2, + "name": "save forlater", + "version": "1.0", + + "description": "Generates a mailto link to save pages via forlater.email", + + "icons": { + "48": "icons/logo-48.png" + }, + "permissions": [ "activeTab", "contextMenus" ], + "browser_action": { + "default_icon": "icons/logo-48.png", + "default_title": "save forlater" + }, + "background": { + "scripts": ["forlater.js"] + } +}