Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox porting #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions manifest.json → chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"version": "1.0",
"permissions": ["contextMenus"],
"background": {
"scripts": ["sample.js"]
"scripts": ["script.js"]
},
"manifest_version": 2,
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
}
}
}
3 changes: 1 addition & 2 deletions script.js → chrome/script.js
Original file line number Diff line number Diff line change
@@ -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});
Expand Down Expand Up @@ -30,4 +29,4 @@ function openOnGoogle(info, tab) {
function openOnDropbox(info, tab) {
const url = "https://dropbox.com/s/" + info.selectionText;
chrome.tabs.create({ url });
}
}
7 changes: 7 additions & 0 deletions firefox/README.md
Original file line number Diff line number Diff line change
@@ -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.
Binary file added firefox/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added firefox/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added firefox/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
32 changes: 32 additions & 0 deletions firefox/script.js
Original file line number Diff line number Diff line change
@@ -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 });
}