browser-extension-manager 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -304,7 +304,7 @@ class Manager {
304
304
  if (user) {
305
305
  // User is signed in - get current stored state to preserve token
306
306
  const result = await new Promise(resolve =>
307
- this.extension.storage.get('bxm:authState', resolve)
307
+ this.extension.storage.local.get('bxm:authState', resolve)
308
308
  );
309
309
  const currentState = result['bxm:authState'] || {};
310
310
 
@@ -321,11 +321,11 @@ class Manager {
321
321
  timestamp: Date.now(),
322
322
  };
323
323
 
324
- await this.extension.storage.set({ 'bxm:authState': authState });
324
+ await this.extension.storage.local.set({ 'bxm:authState': authState });
325
325
  this.logger.log('[AUTH] Auth state synced to storage');
326
326
  } else {
327
327
  // User is signed out - clear storage
328
- await this.extension.storage.remove('bxm:authState');
328
+ await this.extension.storage.local.remove('bxm:authState');
329
329
  this.logger.log('[AUTH] Auth state cleared from storage');
330
330
  }
331
331
  }
@@ -349,11 +349,11 @@ class Manager {
349
349
 
350
350
  // Save token to storage (user state will be synced by onAuthStateChanged)
351
351
  const result = await new Promise(resolve =>
352
- this.extension.storage.get('bxm:authState', resolve)
352
+ this.extension.storage.local.get('bxm:authState', resolve)
353
353
  );
354
354
  const currentState = result['bxm:authState'] || {};
355
355
 
356
- await this.extension.storage.set({
356
+ await this.extension.storage.local.set({
357
357
  'bxm:authState': {
358
358
  ...currentState,
359
359
  token: token,
@@ -112,7 +112,7 @@ Affiliatizer.get = function () {
112
112
  Affiliatizer.initialize = async function (Manager) {
113
113
  // Shortcuts
114
114
  const { extension, logger } = Manager;
115
- const { storage } = extension;
115
+ const storage = extension.storage.local;
116
116
 
117
117
  // Parse the URL
118
118
  const url = new URL(window.location.href);
@@ -29,7 +29,7 @@ async function signInWithStoredToken(context, authState) {
29
29
  // If token is invalid/expired, clear the auth state
30
30
  if (error.code === 'auth/invalid-custom-token' || error.code === 'auth/custom-token-expired') {
31
31
  logger.log('[AUTH-SYNC] Token expired, clearing auth state');
32
- context.extension.storage.remove('bxm:authState');
32
+ context.extension.storage.local.remove('bxm:authState');
33
33
  }
34
34
  }
35
35
  }
@@ -43,7 +43,7 @@ export function setupAuthStorageListener(context) {
43
43
  const { extension, webManager, logger } = context;
44
44
 
45
45
  // Check existing auth state on load and sign in
46
- extension.storage.get('bxm:authState', (result) => {
46
+ extension.storage.local.get('bxm:authState', (result) => {
47
47
  const authState = result['bxm:authState'];
48
48
 
49
49
  if (authState?.token) {
@@ -58,7 +58,7 @@ export function setupAuthStorageListener(context) {
58
58
  if (!state.user) {
59
59
  // User signed out - clear storage so all contexts sync
60
60
  logger.log('[AUTH-SYNC] WM auth signed out, clearing storage...');
61
- extension.storage.remove('bxm:authState');
61
+ extension.storage.local.remove('bxm:authState');
62
62
  }
63
63
  });
64
64
 
@@ -111,15 +111,6 @@ function Extension () {
111
111
  }
112
112
  } catch (e) {}
113
113
 
114
- // Fix storage
115
- if (self.storage) {
116
- if (self.storage.sync) {
117
- self.storage = self.storage.sync
118
- } else if (self.storage.local) {
119
- self.storage = self.storage.local
120
- }
121
- }
122
-
123
114
  // Return the object
124
115
  return self;
125
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-extension-manager",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Browser Extension Manager dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {