File tree Expand file tree Collapse file tree 4 files changed +15
-32
lines changed
Expand file tree Collapse file tree 4 files changed +15
-32
lines changed Original file line number Diff line number Diff line change 22
33let googleApiKey ;
44
5- chrome . runtime . onInstalled . addListener ( ( ) => {
6- chrome . declarativeContent . onPageChanged . removeRules ( undefined , ( ) => {
7- chrome . declarativeContent . onPageChanged . addRules ( [ {
8- conditions : [
9- new chrome . declarativeContent . PageStateMatcher ( {
10- pageUrl : {
11- urlContains : 'script.google.com'
12- }
13- } )
14- ] ,
15- actions : [ new chrome . declarativeContent . ShowPageAction ( ) ]
16- } ] ) ;
17- } ) ;
18- } ) ;
19-
205chrome . runtime . onMessage . addListener ( ( msg , sender , callback ) => {
216 if ( ! msg . cmd ) return ;
227 switch ( msg . cmd ) {
Original file line number Diff line number Diff line change 5555 "permissions" : [
5656 " https://script.google.com/*" ,
5757 " https://www.googleapis.com/oauth2/v4/token" ,
58+ " https://gitlab.com/*" ,
5859 " identity" ,
5960 " storage" ,
60- " declarativeContent" ,
61- " webRequest" ,
62- " https://gitlab.com/*"
61+ " webRequest"
6362 ],
6463 "oauth2" : {
6564 "client_id" : " 971735641612-plgfavrj0vhpsd1brvquo4qt7m91ujs6.apps.googleusercontent.com" ,
Original file line number Diff line number Diff line change @@ -250,18 +250,9 @@ function initPageEvent() {
250250
251251 $ ( document ) . on ( 'click' , '#config-button' , ( ) => {
252252 let config = getConfig ( ) ;
253- if ( ! config ) {
254- config = {
255- filetype : '.gs' ,
256- ignorePattern : [ ] ,
257- manifestEnabled : true ,
258- }
259- }
260- if ( config ) {
261- $ ( '#selected-suffix' ) . text ( config . filetype ) ;
262- $ ( '#manage-manifest' ) . prop ( "checked" , config . manifestEnabled ) ;
263- $ ( '#ignore-pattern' ) . val ( config . ignorePattern . join ( ';' ) ) ;
264- }
253+ $ ( '#selected-suffix' ) . text ( config . filetype ) ;
254+ $ ( '#manage-manifest' ) . prop ( "checked" , config . manifestEnabled ) ;
255+ $ ( '#ignore-pattern' ) . val ( config . ignorePattern . join ( ';' ) ) ;
265256 changeModalState ( 'config' , true ) ;
266257 } ) ;
267258
@@ -390,7 +381,7 @@ function showDiff(code, type) {
390381 let p = new RegExp ( svconfig . ignorePattern [ i ] ) ;
391382 if ( svp . test ( file ) ) return false ;
392383 }
393- const regex = new RegExp ( `(.*?)(${ context . bindConfig [ getId ( ) ] . filetype } |\.html)$` )
384+ const regex = new RegExp ( `(.*?)(${ getConfig ( ) . filetype } |\.html)$` )
394385 const match = file . match ( regex ) ;
395386 return match && match [ 1 ] && match [ 2 ] ;
396387 } )
Original file line number Diff line number Diff line change @@ -14,7 +14,15 @@ function getBranch() {
1414}
1515
1616function getConfig ( ) {
17- return context . bindConfig [ getId ( ) ] ;
17+ let config = context . bindConfig [ getId ( ) ] ;
18+ if ( ! config ) {
19+ config = {
20+ filetype : '.gs' ,
21+ ignorePattern : [ ] ,
22+ manifestEnabled : true ,
23+ }
24+ }
25+ return config ;
1826}
1927
2028function isGist ( ) {
You can’t perform that action at this time.
0 commit comments