File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,15 @@ if (window.location.href.includes("extras/index.html")) {
338338 }
339339}
340340
341+ async function setDefaultThemes ( ) {
342+ if ( ! ( await chrome . storage . sync . get ( "themes" ) ) ?. themes ) {
343+ await chrome . storage . sync . set ( {
344+ themes : defaultThemes ,
345+ } ) ;
346+ }
347+ }
348+ setDefaultThemes ( ) ;
349+
341350async function getThemes ( ) {
342351 document . querySelectorAll ( ".dropdown > *" ) . forEach ( function ( el ) {
343352 el . remove ( ) ;
@@ -1365,12 +1374,14 @@ async function getTrending() {
13651374}
13661375
13671376async function getCommit ( ) {
1368- if ( ! chrome . runtime . getManifest ( ) . version_name . endsWith ( "-beta" ) ) return ;
1369- if ( ! document . querySelector ( ".searchbar" ) ) return ;
1370-
1371- let commit = await ( await fetch ( "/.git/ORIG_HEAD" ) ) . text ( ) ;
1372- document . querySelector ( ".searchbar" ) . placeholder += ` (${ commit . slice (
1373- 0 ,
1374- 7
1375- ) } )`;
1377+ try {
1378+ if ( ! chrome . runtime . getManifest ( ) . version_name . endsWith ( "-beta" ) ) return ;
1379+ if ( ! document . querySelector ( ".searchbar" ) ) return ;
1380+
1381+ let commit = await ( await fetch ( "/.git/ORIG_HEAD" ) ) . text ( ) ;
1382+ document . querySelector ( ".searchbar" ) . placeholder += ` (${ commit . slice (
1383+ 0 ,
1384+ 7
1385+ ) } )`;
1386+ } catch ( err ) { }
13761387}
You can’t perform that action at this time.
0 commit comments