commit 731417edd742deed499289d1e91a525021c72a10 Author: ptrcnull Date: Thu Oct 7 18:57:34 2021 +0200 feat: Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7ca9c1 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# twitter-switch + +Switch Twitter accounts without losing current page diff --git a/background.js b/background.js new file mode 100644 index 0000000..5f320ff --- /dev/null +++ b/background.js @@ -0,0 +1,7 @@ +browser.webRequest.onCompleted.addListener( + () => browser.tabs.reload(), + { + urls: [ "https://twitter.com/i/api/1.1/account/multi/switch.json" ], + types: [ "xmlhttprequest" ] + } +); diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..e220f52 --- /dev/null +++ b/manifest.json @@ -0,0 +1,16 @@ +{ + "description": "Twitter account switch fixer", + "manifest_version": 2, + "name": "twitter-switch", + "version": "1.0", + + "permissions": [ + "webRequest", + "webRequestBlocking", + "https://twitter.com/" + ], + + "background": { + "scripts": ["background.js"] + } +}