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 extension - mv3 release version #5

Open
wants to merge 5 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
6 changes: 0 additions & 6 deletions background.html

This file was deleted.

13 changes: 8 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ function encodeForCyberChef(data) {
}

openInCyberChef = function(word){
var query = word.selectionText;
browser.storage.local.get("my_url", function(items) {
if (!!items.my_url) {
browser.tabs.create({url: items.my_url + "#input=" + encodeForCyberChef(query)});
browser.tabs.create({url: items.my_url + "#input=" + encodeForCyberChef(word)});
} else {
browser.tabs.create({url: "https://gchq.github.io/CyberChef#input=" + encodeForCyberChef(query)});
browser.tabs.create({url: "https://gchq.github.io/CyberChef#input=" + encodeForCyberChef(word)});
}
});
};

browser.contextMenus.create({
title: "Open in CyberChef",
contexts:["selection"],
onclick: openInCyberChef
id: "open-in-cyberchef",
contexts:["selection"]
});

chrome.contextMenus.onClicked.addListener((info, tab) => {
openInCyberChef(info.selectionText);
});
11 changes: 8 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "Open in CyberChef",
"short_name": "CyberChef",
"description": "Adds an open selected text in CyberChef option to the right-click context menu. CyberChef is a tool that can decode, decipher, and uncompress data in a wide variety of formats.",
"version": "0.0.4",
"version": "0.3.0",
"permissions": [
"storage",
"contextMenus",
"tabs"],
"browser_specific_settings": {
"gecko": {
"id": "{18e2eddf-0137-4dcc-bbd4-abf906665bd8}"
}
},
"icons": {
"16": "assets/cyberchef-16x16.png",
"48": "assets/cyberchef-48x48.png",
"128": "assets/cyberchef-128x128.png"
},
"options_ui": {"page": "options.html" },
"background": {"page": "background.html"}
"background": {"scripts": ["main.js"]}
}