Skip to content

Commit c778c99

Browse files
committed
FF
1 parent 6a1d58b commit c778c99

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

background.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function RunScript (tabId, callback) {
4747
let existid = false;
4848
let scripts = await browser.scripting.getRegisteredContentScripts();
4949
for (let scrid of scripts.map((script) => script.id)) {
50-
if (`${tabId}` === scrid) {
50+
if (`${tabId}` == scrid) {
5151
existid = true;
5252
}
5353
}
@@ -61,21 +61,18 @@ async function StopScript (tabId) {
6161
browser.tabs.onUpdated.addListener((tabId, changeInfo, tab)=> {
6262
if (DownloadVideo) {
6363
if (changeInfo.status == 'loading') {
64+
browser.webRequest.onResponseStarted.addListener (WebContent, {urls: ['<all_urls>']}, ['responseHeaders']);
6465
RunScript (tabId, function (existid) {
6566
if (!existid) {
6667
browser.scripting.registerContentScripts([{id: `${tabId}`, allFrames: false, matches: ['<all_urls>'], js: ['content-script.js'], css: ['content-script.css']}]);
6768
}
6869
});
6970
browser.webRequest.onResponseStarted.removeListener (WebContent);
7071
browser.tabs.sendMessage(tabId, {message: 'gdmclean'}).then (function () {}).catch(function() {});
72+
browser.webRequest.onResponseStarted.addListener (WebContent, {urls: ['<all_urls>']}, ['responseHeaders']);
7173
}
72-
browser.webRequest.onResponseStarted.addListener (WebContent, {urls: ['<all_urls>']}, ['responseHeaders']);
7374
} else {
74-
RunScript (tabId, function (existid) {
75-
if (existid) {
76-
StopScript (tabId);
77-
}
78-
});
75+
StopScript (tabId);
7976
}
8077
});
8178

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Integration for Gabut Download Manager.",
44
"short_name": "GabutDM",
55
"homepage_url": "https://github.com/gabutakut/gabutextentionsFF",
6-
"version": "2.6.1",
6+
"version": "2.6.2",
77
"manifest_version": 3,
88
"icons": {
99
"32": "icons/icon_32.png",

popup/popup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<div id="Content0" class="tab-pane active">
3636
<div class="tittle">Gabut Download Manager</div>
3737
<img id="img-icon" src="../icons/icon_128.svg" /></h5>
38-
<div class="tittle">Version 2.6.1</div>
38+
<div class="tittle">Version 2.6.2</div>
3939
</div>
4040
<div id="Content1" class="tab-pane">
4141
<div class="tittle">Interrupt Download</div>

0 commit comments

Comments
 (0)