Skip to content

Commit

Permalink
Add warning about extension storage being disable
Browse files Browse the repository at this point in the history
Fixes issues with Tor and Mullvad browser
Fixes #1894
  • Loading branch information
ajayyy committed Nov 27, 2023
1 parent d62d362 commit 1e5bd80
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion maze-utils
Submodule maze-utils updated 1 files
+12 −0 src/config.ts
2 changes: 1 addition & 1 deletion public/_locales
Submodule _locales updated 1 files
+6 −0 en/messages.json
3 changes: 2 additions & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,15 @@ chrome.runtime.onInstalled.addListener(function () {
const userID = Config.config.userID;

// If there is no userID, then it is the first install.
if (!userID){
if (!userID && !Config.local.alreadyInstalled){
//open up the install page
chrome.tabs.create({url: chrome.extension.getURL("/help/index.html")});

//generate a userID
const newUserID = generateUserID();
//save this UUID
Config.config.userID = newUserID;
Config.local.alreadyInstalled = true;

// Don't show update notification
Config.config.categoryPillUpdate = true;
Expand Down
6 changes: 5 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ interface SBStorage {
/* VideoID prefixes to UUID prefixes */
downvotedSegments: Record<VideoID & HashedValue, VideoDownvotes>;
navigationApiAvailable: boolean;

// Used when sync storage disbaled
alreadyInstalled: boolean;
}

class ConfigClass extends ProtoConfig<SBConfig, SBStorage> {
Expand Down Expand Up @@ -456,7 +459,8 @@ const syncDefaults = {

const localDefaults = {
downvotedSegments: {},
navigationApiAvailable: null
navigationApiAvailable: null,
alreadyInstalled: false
};

const Config = new ConfigClass(syncDefaults, localDefaults, migrateOldSyncFormats);
Expand Down

0 comments on commit 1e5bd80

Please sign in to comment.