feat: initialize Tab Shooter Chrome extension game
This commit is contained in:
commit
0f566b02ac
11 changed files with 1614 additions and 0 deletions
13
background.js
Normal file
13
background.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* Tab Shooter — Background Service Worker (MV3)
|
||||
* Minimal: das Popup übernimmt die gesamte Spiellogik.
|
||||
* Der Service Worker ist erforderlich für die Manifest-Deklaration
|
||||
* und kann künftig z.B. ein Tastenkürzel (commands) anbieten.
|
||||
*/
|
||||
|
||||
// Bei Installation: Default-Highscore setzen, falls nicht vorhanden.
|
||||
chrome.runtime.onInstalled.addListener(async () => {
|
||||
const data = await chrome.storage.local.get("highscore");
|
||||
if (data.highscore === undefined) {
|
||||
await chrome.storage.local.set({ highscore: 0 });
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue