Skip to content

Commit ce9d3b5

Browse files
committed
Fix Firefox redirection issue
1 parent e75ca67 commit ce9d3b5

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ This extension is not affiliated with Instagram, TikTok, Picuki, Imginn, UrleBir
3131

3232
- **Firefox for Desktop**
3333

34-
- Download the [socialswitch-v1.0-firefox.zip](https://github.com/claromes/socialswitch/releases/tag/v1.0) file
34+
- Download the [socialswitch-firefox.xpi](https://github.com/claromes/socialswitch/releases) file
3535
- Open Firefox and navigate to `about:addons`
3636
- From the settings cog, press "Install Add-on From File..." (located at the top-right corner)
3737
- Select the extension file
3838

3939
- **Chrome**
4040

41-
- Download the [socialswitch-v1.0-chrome.zip](https://github.com/claromes/socialswitch/releases/tag/v1.0) file
41+
- Download the [socialswitch-chrome.zip](https://github.com/claromes/socialswitch/releases) file
4242
- Extract the ZIP file
4343
- Open Google Chrome and navigate to `chrome://extensions`
4444
- Enable "Developer Mode" (located at the top-right corner)

firefox/background.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ browser.runtime.onMessage.addListener(function (request, sender, sendResponse) {
3939

4040
browser.webRequest.onBeforeRequest.addListener(
4141
function (details) {
42-
if(details.method === 'POST') {
43-
// let the request go through unchanged
44-
return {};
45-
}
4642
// -- Instagram --
4743
// Get storage option
4844
browser.storage.local.get(
@@ -83,6 +79,7 @@ browser.webRequest.onBeforeRequest.addListener(
8379
}
8480

8581
const handleProfile = details.url.split('/')[3];
82+
const pathSegment = details.url.split('/')[4];
8683
const handleProfileWithPost = details.url.split('/')[4];
8784

8885
// Ignore post, stories, reel, TV and explore URLs
@@ -92,9 +89,11 @@ browser.webRequest.onBeforeRequest.addListener(
9289
handleProfileWithPost !== 'reel' &&
9390
handleProfile !== 'stories' &&
9491
handleProfile !== 's' &&
95-
handleProfile !== 'reel' &&
9692
handleProfile !== 'tv' &&
97-
handleProfile !== 'explore'
93+
handleProfile !== 'explore' &&
94+
// Firefox redirection issue
95+
handleProfile !== 'ajax' &&
96+
!pathSegment.includes('bz?')
9897
) {
9998
// https://instagram.com/<handle>
10099
// https://instagram.com/<handle>/

0 commit comments

Comments
 (0)