Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit aaec895

Browse files
committed
Remove content scripts
1 parent 4e173d3 commit aaec895

File tree

3 files changed

+16
-77
lines changed

3 files changed

+16
-77
lines changed

extension/background.js

+7-16
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ try {
6969
hostName = 'com.javahelps.ugetchromewrapper';
7070
}
7171

72+
current_browser.commands.onCommand.addListener(function(command) {
73+
if ("toggle-interruption" === command) {
74+
// Toggle
75+
setInterruptDownload(!interruptDownloads, true);
76+
}
77+
});
78+
7279
chromeVersion = parseInt(chromeVersion);
7380
sendMessageToHost({
7481
version: "2.1.0"
@@ -117,21 +124,6 @@ var message = {
117124
batch: false
118125
};
119126

120-
// Listen to the key press
121-
current_browser.runtime.onMessage.addListener(function(request, sender, sendResponse) {
122-
var msg = request.message;
123-
if (msg === 'enable') {
124-
// Temporarily enable
125-
setInterruptDownload(true);
126-
} else if (msg == 'disable') {
127-
// Temporarily disable
128-
setInterruptDownload(false);
129-
} else {
130-
// Toggle
131-
setInterruptDownload(!interruptDownloads, true);
132-
}
133-
});
134-
135127
// Add to Chrome context menu
136128
current_browser.contextMenus.create({
137129
title: 'Download with uGet',
@@ -152,7 +144,6 @@ current_browser.contextMenus.onClicked.addListener(function(info, tab) {
152144
message.referrer = info['pageUrl'];
153145
current_browser.cookies.getAll({ 'url': extractRootURL(info.pageUrl) }, parseCookies);
154146
} else if (info.menuItemId === "download_all_links_with_uget") {
155-
var dataToWebPage = { text: 'test', foo: 1, bar: false };
156147
current_browser.tabs.executeScript(null, { file: 'extract.js' }, function(results) {
157148
// Do nothing
158149
if (results[0].success) {

extension/content.js

-49
This file was deleted.

extension/manifest.json

+9-12
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,15 @@
1717
"default_icon": "icon_32.png",
1818
"default_popup": "popup.html"
1919
},
20-
"content_scripts": [{
21-
"all_frames": true,
22-
"js": [
23-
"content.js",
24-
"extract.js"
25-
],
26-
"matches": [
27-
"http://*/*",
28-
"https://*/*"
29-
],
30-
"run_at": "document_start"
31-
}],
20+
"commands": {
21+
"toggle-interruption": {
22+
"suggested_key": {
23+
"default": "Ctrl+Shift+U",
24+
"mac": "Command+Shift+U"
25+
},
26+
"description": "Toggle interruption"
27+
}
28+
},
3229
"description": "uGet Browser Integration extension replaces default download manager by uGet Download Manager.",
3330
"homepage_url": "https://slgobinath.github.io/uget-chrome-wrapper",
3431
"icons": {

0 commit comments

Comments
 (0)