Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
Remove context menu feature and permission
Browse files Browse the repository at this point in the history
  • Loading branch information
electroly committed Aug 17, 2020
1 parent ea2b964 commit efa9ca7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
24 changes: 0 additions & 24 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@ const migrateSettings = async () => {
await setSetting("version", current_version);
};

const addContextMenus = () => {
// get rid of any old and busted context menus
browser.contextMenus.removeAll();

// add some basic context menus
browser.contextMenus.create({
title: "Show comment history",
contexts: ["link"],
onclick: showCommentHistoryClick,
documentUrlPatterns: ["https://*.shacknews.com/*"],
targetUrlPatterns: ["https://*.shacknews.com/profile/*"]
});
};

var notificationsEventId = 0;

const startNotifications = async () => {
Expand Down Expand Up @@ -111,14 +97,6 @@ const notificationClicked = notificationId => {
}
};

const showCommentHistoryClick = (info, tab) => {
let match = /\/profile\/(.+)$/.exec(info.linkUrl);
if (match) {
let search_url = "https://winchatty.com/search?author=" + escape(match[1]);
browser.tabs.create({ windowId: tab.windowId, index: tab.index + 1, url: search_url });
}
};

browser.runtime.onMessage.addListener(async (request, sender) => {
if (request.name === "launchIncognito")
// necessary for opening nsfw links in an incognito window
Expand Down Expand Up @@ -220,8 +198,6 @@ browser.webRequest.onHeadersReceived.addListener(responseListener, { urls: ["htt
"responseHeaders"
]);

addContextMenus();

(async () => {
// attempt to update version settings
await migrateSettings();
Expand Down
1 change: 0 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"tabs",
"storage",
"webRequest",
"contextMenus",
"notifications",
"webRequestBlocking",
"https://api.imgur.com/3/*",
Expand Down

0 comments on commit efa9ca7

Please sign in to comment.