diff --git a/contentScript.js b/contentScript.js index 7db8cd8..40516ed 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1,16 +1,3 @@ -window.addEventListener('message', e => { - if (e.data === 'requestCpuInfo') { - chrome.runtime.sendMessage( - 'requestCpuInfo', - cpuInfo => window.postMessage({ cpuInfo }, '*') - ) - } -}); - -const script = document.createElement('script'); -script.src = chrome.runtime.getURL('initCpuInfo.js'); -document.documentElement.appendChild(script); - const commandButtons = { toggleMute: 'button[data-at=muteAudioBtn]', toggleCamera: 'button[data-at=muteVideoBtn]', diff --git a/initCpuInfo.js b/initCpuInfo.js deleted file mode 100644 index 45873e3..0000000 --- a/initCpuInfo.js +++ /dev/null @@ -1,20 +0,0 @@ -;(function rwcCpuInfoInit() { - let promiseResolvers = []; - window.addEventListener('message', e => { - if (e.data?.cpuInfo && promiseResolvers.length > 0) { - const resultResolver = promiseResolvers.shift(); - resultResolver?.(e.data.cpuInfo); - } - }); - - window.rwc_getCpuInfo = function getCpuInfo() { - let promiseResolver; - const result = new Promise(resolve => { - promiseResolver = resolve; - }); - promiseResolvers.push(promiseResolver); - window.postMessage('requestCpuInfo', '*'); - - return result; - }; -})(); diff --git a/manifest.json b/manifest.json index 1544dbf..263f36c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "background": { "service_worker": "serviceWorker.js" }, - "permissions": ["scripting", "tabs", "system.cpu"], + "permissions": ["tabs"], "action": { "default_popup": "popup.html", "default_icon": { @@ -61,11 +61,5 @@ "matches": ["https://v.ringcentral.com/*"], "js": ["contentScript.js"] } - ], - "web_accessible_resources": [ - { - "matches": ["https://v.ringcentral.com/*"], - "resources": ["initCpuInfo.js"] - } ] } diff --git a/readme.md b/readme.md index 5fa94e5..0173919 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # RC Video Companion -Source for RC Video Companion - chrome extension that simplifies work with RingCentral Video service from a browser. +Source for RC Video Companion - Chrome extension that simplifies work with RingCentral Video service from a browser. Features: * Fast switch to RCV tab from anywhere button/hotkey (in meeting tab is preferred) @@ -8,7 +8,6 @@ Features: * Camera on/off button/hotkey (the same as previous) * Start/stop screen sharing button/hotkey (the same as previous) * Hotkeys customization - * CPU load provisioning (to allow client to minimize power consumption) ## Installation diff --git a/serviceWorker.js b/serviceWorker.js index a4023f1..2f199d1 100644 --- a/serviceWorker.js +++ b/serviceWorker.js @@ -1,17 +1,5 @@ self.importScripts('commands.js'); -chrome.runtime.onMessage.addListener( - function(request, sender, sendResponse) { - if (chrome?.system?.cpu?.getInfo) { - chrome.system.cpu.getInfo(sendResponse); - } else { - sendResponse('unavailable'); - } - - return true; - } -); - chrome.commands.onCommand.addListener(function(command) { if (command in commands) { commands[command]?.();