5,600,234 Members 36,431 Now Online
XDA Developers Android and Mobile Development Forum

[Extension] Updated version of the APK Downloader Chrome Extension

Tip us?
 
Bexton
Old
#21  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 1084
Posts: 607
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
Quote:
Originally Posted by XlAfbk View Post
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})
}};

Google/LG Nexus 5 (32GB, Black) - Android 4.4.2 / KOT49H - Stock 3.4.0 Kernel - HHZ11k - Radio M8974-1.0.25.0.23
Google/LG Nexus 4 (16GB) - Android 4.4 / KRT16O - 3.4.67 ~AK.106.KK - MAKOZ30d - Radio 2.0.1700.97
Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Samsung Galaxy Tab 2 GT-P5110 - Android 4.2.2 / JDQ39E - CM 10.1.1 - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
XlAfbk
Old
#22  
XlAfbk's Avatar
Senior Member
Thanks Meter 251
Posts: 1,199
Join Date: 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.
maguro (GNex), mako (N4), manta (N10), all on CM11 nightlies, faux m kernel.
 
Bexton
Old
#23  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 1084
Posts: 607
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
Quote:
Originally Posted by XlAfbk View Post
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..

Google/LG Nexus 5 (32GB, Black) - Android 4.4.2 / KOT49H - Stock 3.4.0 Kernel - HHZ11k - Radio M8974-1.0.25.0.23
Google/LG Nexus 4 (16GB) - Android 4.4 / KRT16O - 3.4.67 ~AK.106.KK - MAKOZ30d - Radio 2.0.1700.97
Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Samsung Galaxy Tab 2 GT-P5110 - Android 4.2.2 / JDQ39E - CM 10.1.1 - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Bexton
Old
#24  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 1084
Posts: 607
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
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.

Google/LG Nexus 5 (32GB, Black) - Android 4.4.2 / KOT49H - Stock 3.4.0 Kernel - HHZ11k - Radio M8974-1.0.25.0.23
Google/LG Nexus 4 (16GB) - Android 4.4 / KRT16O - 3.4.67 ~AK.106.KK - MAKOZ30d - Radio 2.0.1700.97
Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Samsung Galaxy Tab 2 GT-P5110 - Android 4.2.2 / JDQ39E - CM 10.1.1 - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Bexton
Old
#25  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 1084
Posts: 607
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
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, 1075 views)

Google/LG Nexus 5 (32GB, Black) - Android 4.4.2 / KOT49H - Stock 3.4.0 Kernel - HHZ11k - Radio M8974-1.0.25.0.23
Google/LG Nexus 4 (16GB) - Android 4.4 / KRT16O - 3.4.67 ~AK.106.KK - MAKOZ30d - Radio 2.0.1700.97
Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Samsung Galaxy Tab 2 GT-P5110 - Android 4.2.2 / JDQ39E - CM 10.1.1 - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Felimenta97
Old
#26  
Felimenta97's Avatar
Senior Member
Thanks Meter 2221
Posts: 7,604
Join Date: Aug 2011
Location: Ribeirão Preto
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...

 
Bexton
Old
#27  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 1084
Posts: 607
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
Quote:
Originally Posted by Felimenta97 View Post
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.

Google/LG Nexus 5 (32GB, Black) - Android 4.4.2 / KOT49H - Stock 3.4.0 Kernel - HHZ11k - Radio M8974-1.0.25.0.23
Google/LG Nexus 4 (16GB) - Android 4.4 / KRT16O - 3.4.67 ~AK.106.KK - MAKOZ30d - Radio 2.0.1700.97
Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Samsung Galaxy Tab 2 GT-P5110 - Android 4.2.2 / JDQ39E - CM 10.1.1 - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Bexton
Old
#28  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 1084
Posts: 607
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
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, 1014 views)

Google/LG Nexus 5 (32GB, Black) - Android 4.4.2 / KOT49H - Stock 3.4.0 Kernel - HHZ11k - Radio M8974-1.0.25.0.23
Google/LG Nexus 4 (16GB) - Android 4.4 / KRT16O - 3.4.67 ~AK.106.KK - MAKOZ30d - Radio 2.0.1700.97
Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Samsung Galaxy Tab 2 GT-P5110 - Android 4.2.2 / JDQ39E - CM 10.1.1 - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Felimenta97
Old
#29  
Felimenta97's Avatar
Senior Member
Thanks Meter 2221
Posts: 7,604
Join Date: Aug 2011
Location: Ribeirão Preto
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

 
ytain
Old
#30  
Member
Thanks Meter 7
Posts: 38
Join Date: 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.

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

Advanced Search
Display Modes