Skip to content

Commit

Permalink
fixed #6
Browse files Browse the repository at this point in the history
  • Loading branch information
jae-jae committed May 11, 2018
1 parent 313e48f commit 4d24e31
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions app/scripts.babel/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ let getTabUrl = () => {

}

let isIgnore = (down) => {
if (
/^blob:/.test(down.finalUrl)
|| getStorage('enabled') == 0
|| Math.abs(down.fileSize) < getStorage('size')
) {
console.log('Ignore file')
return true;
}
return false
}

setInterval(() => {
getGlobalStatus((data) => {
let num = data['result']['numActive']
Expand Down Expand Up @@ -109,10 +121,11 @@ chrome.downloads.onDeterminingFilename.addListener(function (down) {
chrome.tabs.create({ 'url': 'options.html' }, function (s) { });
return 0;
}
if (getStorage('enabled') == 0 || Math.abs(down.fileSize) < getStorage('size')) {
return 0;

if (isIgnore(down)) {
return 0
}

let downloadUrl = down.finalUrl
let enableFilter = getStorage('enableFilter')
let filterUrls = getStorage('filterUrlRegs')
Expand Down

0 comments on commit 4d24e31

Please sign in to comment.