From 7c3c54bad733884591ec23d5fd7e195e9f8656f1 Mon Sep 17 00:00:00 2001 From: Liam Steckler Date: Tue, 15 Oct 2024 12:34:20 -0700 Subject: [PATCH] Update extension to self-uninstall after update, since Talkdesk now directly support Microsoft Edge --- talkdesk-useragent-switcher/manifest.json | 29 +++++-------------- talkdesk-useragent-switcher/service-worker.js | 5 ++++ .../talkdesk_useragent_rule.json | 21 -------------- 3 files changed, 12 insertions(+), 43 deletions(-) create mode 100644 talkdesk-useragent-switcher/service-worker.js delete mode 100644 talkdesk-useragent-switcher/talkdesk_useragent_rule.json diff --git a/talkdesk-useragent-switcher/manifest.json b/talkdesk-useragent-switcher/manifest.json index c86375a..b8263bf 100755 --- a/talkdesk-useragent-switcher/manifest.json +++ b/talkdesk-useragent-switcher/manifest.json @@ -1,17 +1,8 @@ { "manifest_version": 3, "name": "Talkdesk User Agent Switcher", - "version": "1.0.1", - "description": "Sets the User Agent header to one from Google Chrome when accessing Talkdesk sites, as they block any other User Agent.", - "permissions": [ - "declarativeNetRequestWithHostAccess" - ], - "host_permissions": [ - "*://*.talkdesk.com/*", - "*://*.talkdeskid.com/*", - "*://*.mytalkdesk.com/*", - "*://*.talkdeskapp.com/*" - ], + "version": "2.0.0", + "description": "An extension that previously set the User Agent header to one from Google Chrome when accessing Talkdesk sites, as they blocked any other User Agent. This is no longer required, as Talkdesk has added Microsoft Edge as a supported browser.", "icons": { "16": "icons/icon-16.png", "32": "icons/icon-32.png", @@ -20,14 +11,8 @@ "128": "icons/icon-128.png", "256": "icons/icon-256.png" }, - "declarative_net_request": { - "rule_resources": [ - { - "id": "talkdesk_useragent_ruleset", - "enabled": true, - "path": "talkdesk_useragent_rule.json" - } - ] - }, - "homepage_url": "https://scm.gruezi.net/buckbanzai/talkdesk-useragent-switcher" -} + "homepage_url": "https://scm.gruezi.net/buckbanzai/talkdesk-useragent-switcher", + "background": { + "service_worker": "service-worker.js" + } +} \ No newline at end of file diff --git a/talkdesk-useragent-switcher/service-worker.js b/talkdesk-useragent-switcher/service-worker.js new file mode 100644 index 0000000..cdd51c8 --- /dev/null +++ b/talkdesk-useragent-switcher/service-worker.js @@ -0,0 +1,5 @@ +chrome.runtime.onInstalled.addListener(() => { + chrome.management.uninstallSelf({ + "showConfirmDialog": false + }); +}); \ No newline at end of file diff --git a/talkdesk-useragent-switcher/talkdesk_useragent_rule.json b/talkdesk-useragent-switcher/talkdesk_useragent_rule.json deleted file mode 100644 index 3fd4f43..0000000 --- a/talkdesk-useragent-switcher/talkdesk_useragent_rule.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "id": 1, - "priority": 1, - "action": { - "type": "modifyHeaders", - "requestHeaders": [ - { - "operation": "set", - "header": "User-Agent", - "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" - } - ] - }, - "condition": { - "resourceTypes": [ - "main_frame" - ] - } - } -] \ No newline at end of file