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

Commit

Permalink
Skip Google doc and fix bug in downloading url with 'version' text
Browse files Browse the repository at this point in the history
  • Loading branch information
slgobinath committed Nov 1, 2016
1 parent 628acf1 commit 354cdd4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 deletions chrome-extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ try {
chromeVersion = 33;
}
chromeVersion = parseInt(chromeVersion);
sendMessageToHost({ version: "1.1.1" });
sendMessageToHost({ version: "1.1.2" });


// Message format to send the download information to the uget-chrome-wrapper
Expand Down Expand Up @@ -137,16 +137,16 @@ chrome.webRequest.onHeadersReceived.addListener(function(details) {
};
}

interruptDownload = false;
message.url = details.url;
var contentType = "";

if (details.url.includes("//docs.google.com/")) { // Cannot download from Google Docs
if (details.url.includes("//docs.google.com/") || details.url.includes("googleusercontent.com/docs")) { // Cannot download from Google Docs
return {
responseHeaders: details.responseHeaders
};
}

interruptDownload = false;
message.url = details.url;
var contentType = "";

for (var i = 0; i < details.responseHeaders.length; ++i) {
if (details.responseHeaders[i].name.toLowerCase() == 'content-length') {
message.filesize = details.responseHeaders[i].value;
Expand Down
2 changes: 1 addition & 1 deletion chrome-extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
"webRequestBlocking",
"nativeMessaging"
],
"version": "1.1.1"
"version": "1.1.2"
}
4 changes: 2 additions & 2 deletions uget-chrome-wrapper/bin/uget-chrome-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ from urlparse import urlparse
from os.path import splitext, basename, join, expanduser

UGET_COMMAND = "uget-gtk"
VERSION = "1.3.0"
VERSION = "1.3.2"

# Platform specific configuration
if sys.platform == "win32":
Expand Down Expand Up @@ -59,7 +59,7 @@ def read_message():
text = sys.stdin.read(text_length).decode('utf-8')

if text:
if "version" in text:
if not 'url' in text:
send_message('{"enable": true, "version": "' + VERSION + '"}')
return

Expand Down
4 changes: 3 additions & 1 deletion uget-chrome-wrapper/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
uget-chrome-wrapper (1.3.1-1) xenial; urgency=medium
uget-chrome-wrapper (1.3.2-1) xenial; urgency=medium

* Fixing bug in urls with 'version'

* Downgrading Python dependency

* Adding support for Chromium and Vivaldi
Expand Down

0 comments on commit 354cdd4

Please sign in to comment.