@@ -3,6 +3,10 @@ chrome.tabs.onCreated.addListener(function(tab) {
33 chrome . tabs . update ( tab . id , { autoDiscardable : false } ) ;
44} ) ;
55
6+ chrome . tabs . onReplaced . addListener ( function ( tabId ) {
7+ chrome . tabs . update ( tabId , { autoDiscardable : false } ) ;
8+ } ) ;
9+
610chrome . runtime . onInstalled . addListener ( function ( details ) {
711 chrome . tabs . query ( { } , function ( tabs ) {
812 tabs . forEach ( function ( tab ) {
@@ -11,6 +15,26 @@ chrome.runtime.onInstalled.addListener(function(details) {
1115 } ) ;
1216} ) ;
1317
14- chrome . tabs . onUpdated . addListener ( function ( tabId , changeInfo , tab ) {
15- if ( changeInfo . discarded ) chrome . tabs . reload ( tabId ) ;
18+
19+ chrome . runtime . setUninstallURL ( "https://chrome.google.com/webstore/detail/dnhngfnfolbmhgealdpolmhimnoliiok/support" ) ;
20+
21+ chrome . contextMenus . create ( {
22+ id : "review" ,
23+ title : "🌟 " + chrome . i18n . getMessage ( "cm_review" ) ,
24+ contexts : [ "browser_action" ]
25+ } ) ;
26+ chrome . contextMenus . create ( {
27+ id : "support" ,
28+ title : "💬 " + chrome . i18n . getMessage ( "cm_support" ) ,
29+ contexts : [ "browser_action" ]
30+ } ) ;
31+ chrome . contextMenus . onClicked . addListener ( function ( info , tab ) {
32+ switch ( info . menuItemId ) {
33+ case "review" :
34+ chrome . tabs . create ( { url : "https://chrome.google.com/webstore/detail/dnhngfnfolbmhgealdpolmhimnoliiok/reviews" } ) ;
35+ break ;
36+ case "support" :
37+ chrome . tabs . create ( { url : "https://chrome.google.com/webstore/detail/dnhngfnfolbmhgealdpolmhimnoliiok/support" } ) ;
38+ break ;
39+ }
1640} ) ;
0 commit comments