Integrated internal statistics (#74)

This commit is contained in:
nobody 2020-08-08 07:30:04 +02:00
parent b7558a1bf6
commit eac3025f8c
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 16 additions and 1 deletions

View File

@ -71,6 +71,9 @@ stateManager.registerInjection = function (tabIdentifier, injection) {
[Setting.AMOUNT_INJECTED]: ++interceptor.amountInjected
});
}
if (stateManager.internalStatistics) {
stats.setStats(injection);
}
};
stateManager.addDomainToWhitelist = function (domain) {
@ -215,6 +218,9 @@ stateManager._handleStorageChanged = function (changes) {
if (Setting.SELECTED_ICON in changes) {
stateManager.selectedIcon = changes.selectedIcon.newValue;
}
if (Setting.INTERNAL_STATISTICS in changes) {
stateManager.internalStatistics = changes.internalStatistics.newValue;
}
};
stateManager._clearBadgeText = function (tabIdentifier) {
@ -267,6 +273,7 @@ stateManager.tabs = {};
stateManager.getInvertOption = false;
stateManager.validHosts = [];
stateManager.selectedIcon = 'Default';
stateManager.internalStatistics = false;
for (let mapping in mappings) {
@ -290,6 +297,11 @@ chrome.storage.sync.get([Setting.SHOW_ICON_BADGE, Setting.SELECTED_ICON], functi
stateManager.selectedIcon = items.selectedIcon;
});
chrome.storage.local.get([Setting.INTERNAL_STATISTICS], function (items) {
stateManager.internalStatistics = items.internalStatistics;
});
/**
* Event Handlers
*/

View File

@ -5,9 +5,12 @@
<meta charset="utf-8" />
</head>
<body>
<script src="../../core/constants.js"></script>
<script src="../../modules/internal/wrappers.js"></script>
<script src="../../modules/internal/helpers.js"></script>
<script src="../../core/constants.js"></script>
<script src="../../modules/internal/stats.js"></script>
<script src="../../core/resources.js"></script>
<script src="../../core/mappings.js"></script>
<script src="../../core/shorthands.js"></script>