Integrated internal statistics (#74)
This commit is contained in:
parent
b7558a1bf6
commit
eac3025f8c
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue