Post Reply

[Extension] Updated version of the APK Downloader Chrome Extension

13th August 2012, 09:58 PM   |  #21  
Bexton's Avatar
OP Recognized Contributor
Flag 50° 56' 33" 6° 57' 32"
Thanks Meter: 1,104
 
608 posts
Join Date:Joined: Sep 2011
More
Quote:
Originally Posted by XlAfbk

I tried modding the extension but for some reason it even fails with localhost instead of this thread, just replacing the 1 line containing the url *confused* (not a chrome extension guy so probably missing something there. more of a web dev)
Maybe if you'd explain why that is and why it needs some site in the first place I'd be able to figure it out.

You need to change two files. The "match"-url for the content script in manifest.json, needs to match the url for the chrome.tabs.create call in main.js:

1.) manifest.json
Code:
"content_scripts": [
  {
    "matches": ["http://forum.xda-developers.com/showthread.php?t=1809458&download=apk*"],
    "js": ["download.js"]
  },
2.) main.js
Code:
executeRawHttpsQuery:function(c) {
  chrome.tabs.create({url:"http://forum.xda-developers.com/showthread.php?t=1809458&download=apk#" + c})
}};
13th August 2012, 10:29 PM   |  #22  
XlAfbk's Avatar
Senior Member
Thanks Meter: 254
 
1,206 posts
Join Date:Joined: Aug 2010
doh. I greped *.js only ...
hm, i see, a page needs to be opened because chrome extensions can only inject scripts into existing pages so to be able to call the function it needs a tab. will have to learn about chrome extensions to try to change that i guess.
13th August 2012, 10:49 PM   |  #23  
Bexton's Avatar
OP Recognized Contributor
Flag 50° 56' 33" 6° 57' 32"
Thanks Meter: 1,104
 
608 posts
Join Date:Joined: Sep 2011
More
Quote:
Originally Posted by XlAfbk

doh. I greped *.js only ...
hm, i see, a page needs to be opened because chrome extensions can only inject scripts into existing pages so to be able to call the function it needs a tab. will have to learn about chrome extensions to try to change that i guess.

more exactly, the page doesn't need to exist. but you need any URL as a "trigger" to call the content script (eg download script). however, I just had an idea. It may be possible to reload the actual play store url and append the hash key to that URL. Let me check on that..
13th August 2012, 11:06 PM   |  #24  
Bexton's Avatar
OP Recognized Contributor
Flag 50° 56' 33" 6° 57' 32"
Thanks Meter: 1,104
 
608 posts
Join Date:Joined: Sep 2011
More
Okay, it works! I will upload an updated version. Instead of open a new tab with this thread it will just reload the Play Store Url and start the download.
13th August 2012, 11:34 PM   |  #25  
Bexton's Avatar
OP Recognized Contributor
Flag 50° 56' 33" 6° 57' 32"
Thanks Meter: 1,104
 
608 posts
Join Date:Joined: Sep 2011
More
APK Downloader 1.3.2

Changelog
This version will no longer open a new tab.
Instead, it will reload the Play Store Url within the same tab in which you clicked on the extension icon and start the download.
Attached Files
File Type: zip apkdownloader-bexmod-1.3.2.zip - [Click for QR Code] (42.7 KB, 1131 views)
14th August 2012, 12:38 AM   |  #26  
Felimenta97's Avatar
Senior Member
Flag Ribeirão Preto
Thanks Meter: 2,318
 
7,830 posts
Join Date:Joined: Aug 2011
More
Well, it doesn't work at all here. It quickly gives a sign the page is reloading but nothing changes, and there is only a small white box below the APK downloader icon...
14th August 2012, 01:38 AM   |  #27  
Bexton's Avatar
OP Recognized Contributor
Flag 50° 56' 33" 6° 57' 32"
Thanks Meter: 1,104
 
608 posts
Join Date:Joined: Sep 2011
More
Quote:
Originally Posted by Felimenta97

Well, it doesn't work at all here. It quickly gives a sign the page is reloading but nothing changes, and there is only a small white box below the APK downloader icon...

Okay, sorry for the mess. But that's when you working with somebody else's code. I re-wrote the extension a clean way and reduced the number of files from 16 to 12. Everything should work now as expected with the 1.3.2 release.

Means: By clicking on the page action icon (the market case), the current page in your browser will reload the same URL (+ &download=apk#SOMEHASHKEY) and start the download.

I've tested it with about 20 apks and it worked out without any issues. But please leave some feedback to ensure it is working for "all" chrome versions.
14th August 2012, 01:40 AM   |  #28  
Bexton's Avatar
OP Recognized Contributor
Flag 50° 56' 33" 6° 57' 32"
Thanks Meter: 1,104
 
608 posts
Join Date:Joined: Sep 2011
More
APK Downloader 1.3.3

Changelog
* Fixed redirect bug (introduced in 1.3.2)
* Major code clean up
Attached Files
File Type: zip apkdownloader-bexmod-1.3.3.zip - [Click for QR Code] (43.1 KB, 1054 views)
14th August 2012, 02:02 AM   |  #29  
Felimenta97's Avatar
Senior Member
Flag Ribeirão Preto
Thanks Meter: 2,318
 
7,830 posts
Join Date:Joined: Aug 2011
More
I will try tomorrow night (it's night now, so a little less than 24 hours from now)

Sent from my LT26i with Tapatalk 2
14th August 2012, 03:18 AM   |  #30  
Member
Thanks Meter: 8
 
38 posts
Join Date:Joined: Feb 2011
Still doesn't work for me, it doesn't download anything even for those I can get via market in Android on my tablet.

Post Reply Subscribe to Thread

Tags
apk downloader
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Apps and Games by ThreadRank