This repository was archived by the owner on Mar 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 2828 chromeVersion = 33 ;
2929}
3030chromeVersion = parseInt ( chromeVersion ) ;
31- sendMessageToHost ( { version : "1.1.2 " } ) ;
31+ sendMessageToHost ( { version : "1.1.3 " } ) ;
3232
3333
3434// Message format to send the download information to the uget-chrome-wrapper
@@ -73,6 +73,27 @@ function postParams(source) {
7373 }
7474 return array . join ( '&' ) ;
7575}
76+
77+ // Add to Chrome context menu
78+ chrome . contextMenus . create (
79+ {
80+ title : 'Download with uGet' ,
81+ id : "download_with_uget" ,
82+ contexts : [ 'link' ]
83+ }
84+ ) ;
85+
86+ chrome . contextMenus . onClicked . addListener ( function ( info , tab ) {
87+ "use strict" ;
88+ if ( info . menuItemId === "download_with_uget" ) {
89+ clearMessage ( ) ;
90+ message . url = info [ 'linkUrl' ] ;
91+ message . referrer = info [ 'pageUrl' ] ;
92+ sendMessageToHost ( message ) ;
93+ clearMessage ( ) ;
94+ }
95+ } ) ;
96+
7697chrome . webRequest . onBeforeRequest . addListener ( function ( details ) {
7798 if ( details . method == 'POST' ) {
7899 message . postdata = postParams ( details . requestBody . formData ) ;
Original file line number Diff line number Diff line change 3636 " <all_urls>" ,
3737 " webRequest" ,
3838 " webRequestBlocking" ,
39- " nativeMessaging"
39+ " nativeMessaging" ,
40+ " contextMenus"
4041 ],
41- "version" : " 1.1.2 "
42+ "version" : " 1.1.3 "
4243}
You can’t perform that action at this time.
0 commit comments