diff --git a/README.md b/chrome/README.md similarity index 100% rename from README.md rename to chrome/README.md diff --git a/icon128.png b/chrome/icon128.png similarity index 100% rename from icon128.png rename to chrome/icon128.png diff --git a/icon16.png b/chrome/icon16.png similarity index 100% rename from icon16.png rename to chrome/icon16.png diff --git a/icon48.png b/chrome/icon48.png similarity index 100% rename from icon48.png rename to chrome/icon48.png diff --git a/manifest.json b/chrome/manifest.json similarity index 90% rename from manifest.json rename to chrome/manifest.json index 8900940..dde7525 100644 --- a/manifest.json +++ b/chrome/manifest.json @@ -4,7 +4,7 @@ "version": "1.0", "permissions": ["contextMenus"], "background": { - "scripts": ["sample.js"] + "scripts": ["script.js"] }, "manifest_version": 2, "icons": { @@ -12,4 +12,4 @@ "48": "icon48.png", "128": "icon128.png" } -} +} \ No newline at end of file diff --git a/script.js b/chrome/script.js similarity index 99% rename from script.js rename to chrome/script.js index 7787ad9..387577f 100644 --- a/script.js +++ b/chrome/script.js @@ -1,4 +1,3 @@ - // Create a parent item and two children. var parent = chrome.contextMenus.create({"title": "trill - Open on...", "contexts": ["selection"]}); var child1 = chrome.contextMenus.create({"title": "dbr.ee", "contexts": ["selection"], "parentId": parent, "onclick": openOnDbree}); @@ -30,4 +29,4 @@ function openOnGoogle(info, tab) { function openOnDropbox(info, tab) { const url = "https://dropbox.com/s/" + info.selectionText; chrome.tabs.create({ url }); -} +} \ No newline at end of file diff --git a/firefox/README.md b/firefox/README.md new file mode 100644 index 0000000..b9539bf --- /dev/null +++ b/firefox/README.md @@ -0,0 +1,7 @@ +# /r/xtrill Chrome Extension + +This extension can be thought of as a fork with which can assist you in eating. It allows you to quickly navigate to download sites given only a key, saving you literally SECONDS of your life. Hey, those seconds add up. + +## Contributions + +Open github issues or pull requests, or message me on reddit. diff --git a/firefox/icon128.png b/firefox/icon128.png new file mode 100644 index 0000000..7d7b975 Binary files /dev/null and b/firefox/icon128.png differ diff --git a/firefox/icon16.png b/firefox/icon16.png new file mode 100644 index 0000000..b665a5c Binary files /dev/null and b/firefox/icon16.png differ diff --git a/firefox/icon48.png b/firefox/icon48.png new file mode 100644 index 0000000..5ac6398 Binary files /dev/null and b/firefox/icon48.png differ diff --git a/firefox/manifest.json b/firefox/manifest.json new file mode 100644 index 0000000..a113c89 --- /dev/null +++ b/firefox/manifest.json @@ -0,0 +1,15 @@ +{ + "name": "/r/xtrill Tools", + "description": "Easily navigate to download pages from x/trill keys", + "version": "1.0", + "permissions": ["menus"], + "background": { + "scripts": ["script.js"] + }, + "manifest_version": 2, + "icons": { + "16": "icon16.png", + "48": "icon48.png", + "128": "icon128.png" + } +} diff --git a/firefox/script.js b/firefox/script.js new file mode 100644 index 0000000..8a0290b --- /dev/null +++ b/firefox/script.js @@ -0,0 +1,32 @@ +// Create a parent item and children for each hosting site. +var parent = browser.menus.create({title: "trill - Open on...", contexts: ["selection"]}); +browser.menus.create({title: "dbr.ee", contexts: ["selection"], parentId: parent, onclick: openOnDbree}); +browser.menus.create({title: "we.tl", contexts: ["selection"], parentId: parent, onclick: openOnWetl}); +browser.menus.create({title: "mega.nz", contexts: ["selection"], parentId: parent, onclick: openOnMega}); +browser.menus.create({title: "Google Drive", contexts: ["selection"], parentId: parent, onclick: openOnGoogle}); +browser.menus.create({title: "Dropbox", contexts: ["selection"], parentId: parent, onclick: openOnDropbox}); + +function openOnDbree(info, tab) { + const url = "https://dbr.ee/" + info.selectionText; + browser.tabs.create({ url }); +} + +function openOnWetl(info, tab) { + const url = "https://we.tl/" + info.selectionText; + browser.tabs.create({ url }); +} + +function openOnMega(info, tab) { + const url = "https://mega.nz/" + info.selectionText; + browser.tabs.create({ url }); +} + +function openOnGoogle(info, tab) { + const url = "https://drive.google.com/file/d/" + info.selectionText; + browser.tabs.create({ url }); +} + +function openOnDropbox(info, tab) { + const url = "https://dropbox.com/s/" + info.selectionText; + browser.tabs.create({ url }); +}