Skip to content
Snippets Groups Projects
Verified Commit db4b4986 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Fix a rare injection counter issue

parent bb31683b
No related branches found
No related tags found
No related merge requests found
...@@ -54,9 +54,23 @@ stateManager.registerInjection = function (tabIdentifier, injection) { ...@@ -54,9 +54,23 @@ stateManager.registerInjection = function (tabIdentifier, injection) {
}); });
} }
chrome.storage.local.set({ if (isNaN(interceptor.amountInjected)) {
'amountInjected': ++interceptor.amountInjected
}); chrome.storage.local.get('amountInjected', function (items) {
interceptor.amountInjected = items.amountInjected;
chrome.storage.local.set({
'amountInjected': ++interceptor.amountInjected
});
});
} else {
chrome.storage.local.set({
'amountInjected': ++interceptor.amountInjected
});
}
}; };
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment