feat: disabled enabledOrigins handling and clean up unused code in webrtc-internals-exporter
This commit is contained in:
@@ -15,11 +15,7 @@ const DEFAULT_OPTIONS = {
|
||||
updateInterval: 2,
|
||||
gzip: false,
|
||||
job: "webrtc-internals-exporter",
|
||||
enabledOrigins: {
|
||||
"http://*/*": true,
|
||||
"https://*/*": true,
|
||||
"https://tube.kobim.cloud": true,
|
||||
},
|
||||
enabledOrigins: { },
|
||||
enabledStats: ["data-channel", "local-candidate", "remote-candidate"]
|
||||
};
|
||||
|
||||
@@ -48,7 +44,7 @@ async function updateTabInfo(tab) {
|
||||
const tabId = tab.id;
|
||||
const origin = new URL(tab.url || tab.pendingUrl).origin;
|
||||
|
||||
if (options.enabledOrigins && options.enabledOrigins[origin] === true) {
|
||||
if (options.enabledOrigins) {
|
||||
const { peerConnectionsPerOrigin } = await chrome.storage.local.get(
|
||||
"peerConnectionsPerOrigin",
|
||||
);
|
||||
|
@@ -46,8 +46,7 @@ if (window.location.protocol.startsWith("http")) {
|
||||
log(`options loaded:`, ret);
|
||||
options.url = ret.url || "";
|
||||
options.enabled =
|
||||
ret.enabledOrigins &&
|
||||
ret.enabledOrigins[window.location.origin] === true;
|
||||
ret.enabledOrigins;
|
||||
options.updateInterval = (ret.updateInterval || 2) * 1000;
|
||||
options.enabledStats = Object.values(ret.enabledStats || {});
|
||||
sendOptions();
|
||||
|
@@ -65,7 +65,6 @@ class WebrtcInternalExporter {
|
||||
}
|
||||
}
|
||||
|
||||
//if (stats.length !== 0) {
|
||||
window.postMessage(
|
||||
{
|
||||
event: "webrtc-internal-exporter:peer-connections-stats",
|
||||
@@ -75,7 +74,6 @@ class WebrtcInternalExporter {
|
||||
);
|
||||
|
||||
log(`Stats collected:`, stats);
|
||||
//}
|
||||
|
||||
setTimeout(this.collectAllStats.bind(this), this.updateInterval);
|
||||
return stats;
|
||||
|
Reference in New Issue
Block a user