@@ -49,8 +49,7 @@ async function checkBetaUpdates() {
4949 ) . json ( ) ;
5050 if (
5151 data . version !== chrome . runtime . getManifest ( ) . version_name ||
52- ( await ( await fetch ( "/changelog/beta.json" ) ) . json ( ) ) . beta !==
53- data . beta
52+ ( await ( await fetch ( "/changelog/beta.json" ) ) . json ( ) ) . beta !== data . beta
5453 ) {
5554 // chrome.tabs.create({
5655 // url: "/extras/beta/index.html",
@@ -64,6 +63,7 @@ if (chrome.runtime.getManifest().version_name.endsWith("-beta")) {
6463}
6564
6665chrome . runtime . onInstalled . addListener ( async function ( object ) {
66+ checkApril ( ) ;
6767 try {
6868 var featureData = await ( await fetch ( "/features/features.json" ) ) . json ( ) ;
6969 } catch ( err ) {
@@ -671,12 +671,17 @@ chrome.runtime.onMessageExternal.addListener(async function (
671671 }
672672 if ( msg . msg === "openPong" ) {
673673 await chrome . tabs . create ( {
674- url : "/api/april/pong/index.html?username=" + msg . username + "&id=" + msg . id ,
674+ url :
675+ "/api/april/pong/index.html?username=" + msg . username + "&id=" + msg . id ,
675676 } ) ;
676677 }
677678 if ( msg . msg === "openDashboardPage" ) {
678679 await chrome . tabs . create ( {
679- url : "/extras/dashboard/index.html?code=" + msg . token + "&username=" + msg . username ,
680+ url :
681+ "/extras/dashboard/index.html?code=" +
682+ msg . token +
683+ "&username=" +
684+ msg . username ,
680685 } ) ;
681686 chrome . tabs . remove ( sender . tab . id , function ( ) { } ) ;
682687 }
@@ -821,7 +826,32 @@ chrome.runtime.onMessage.addListener(async function (
821826 }
822827} ) ;
823828
829+ async function checkApril ( ) {
830+ if ( new Date ( ) . getMonth ( ) === 3 && new Date ( ) . getDate ( ) === 1 ) {
831+ let features = ( await chrome . storage . sync . get ( "features" ) ) ?. features || "" ;
832+ if ( ! features . includes ( "random-block-colors" ) ) {
833+ await chrome . storage . sync . set ( { aprilAutomatic2025 : true } ) ;
834+ features = features + ".random-block-colors" ;
835+ await chrome . storage . sync . set ( { features } ) ;
836+ }
837+ } else {
838+ let aprilAutomatic = ( await chrome . storage . sync . get ( "aprilAutomatic2025" ) )
839+ ?. aprilAutomatic2025 ;
840+
841+ if ( aprilAutomatic ) {
842+ let features =
843+ ( await chrome . storage . sync . get ( "features" ) ) ?. features || "" ;
844+ if ( features . includes ( "random-block-colors" ) ) {
845+ features = features . replaceAll ( "random-block-colors" , "" ) ;
846+ await chrome . storage . sync . set ( { features } ) ;
847+ await chrome . storage . sync . set ( { aprilAutomatic2025 : false } ) ;
848+ }
849+ }
850+ }
851+ }
852+
824853chrome . alarms . onAlarm . addListener ( async function ( ) {
854+ checkApril ( ) ;
825855 chrome . alarms . clearAll ( ) ;
826856 chrome . alarms . create ( "test" , {
827857 delayInMinutes : 0.5 ,
0 commit comments