Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This extension works on Firefox #9

Closed
haxibami opened this issue Aug 19, 2023 · 29 comments
Closed

This extension works on Firefox #9

haxibami opened this issue Aug 19, 2023 · 29 comments

Comments

@haxibami
Copy link
Contributor

haxibami commented Aug 19, 2023

Procedure (after installation)

Note: I tested this with OldTweetDeckFirefox.zip v1, generated by npm run build.

Note2: This procedure is for v1, not v2

1. Grant permissions manually

In the current implementation of Manifest V3, Firefox treats some permissions listed in host_permissions as "optional". So users need to manually grant them from "about:addons > Extensions > Old TweetDeck > Manage > Permissions".

manually granting permissions

2. Disable tracking protection

Also, Firefox's "Enhanced Tracking Protection" prevents <iframe> elements (inserted by this extension) from loading correctly. You can add exception for TweetDeck.

disabling tracking protection

@archeruwu
Copy link
Contributor

How were you able to install it?

@haxibami
Copy link
Contributor Author

The author provides a build script (pack.js) for Firefox. You can run it to generate a patched .zip file.

git clone https://github.com/dimdenGD/OldTweetDeck.git
cd OldTweetDeck
npm install
npm run build
mv ../OldTweetDeckFirefox.zip ./

You should then find OldTweetDeckFirefox.zip. Try temporary installation (unsigned) or self-distribution (signed), as you wish.

@archeruwu
Copy link
Contributor

Thank you!

@Koraydi

This comment was marked as off-topic.

@archeruwu
Copy link
Contributor

Heads up!

You will need Firefox Developer or Nightly to add unsigned extensions.

@haxibami
Copy link
Contributor Author

When I try to run the pack.js file I get this error

image

The pack.js file seems to be running as JScript, not JavaScript. How did you run it? do you have Node.js installed?

@Koraydi
Copy link

Koraydi commented Aug 19, 2023

When I try to run the pack.js file I get this error
image

The pack.js file seems to be running as JScript, not JavaScript. How did you run it? do you have Node.js installed?

I double clicked on the file in the folder and it gave that error. I have installed Node.js and attempted to run the script with it but it opens for a split second and then closes after doing seemingly nothing.

@dimdenGD
Copy link
Owner

check parent folder of folder it's in, archives probably appeared in it

@dimdenGD dimdenGD pinned this issue Aug 19, 2023
@Koraydi
Copy link

Koraydi commented Aug 19, 2023

image
I managed to catch it with a screen recorder

@dimdenGD
Copy link
Owner

run npm install in the folder

@dimdenGD
Copy link
Owner

dimdenGD commented Aug 19, 2023

I've built extension and made a Release, check https://github.com/dimdenGD/OldTweetDeck/releases/tag/v1.0.2

@Mara-Li
Copy link

Mara-Li commented Aug 19, 2023

Sorry, I feel stupid, but I can't understand how to "add" the zip into firefox :s. When I try to load it (using developer version or my normal version) I get an error.
I downloaded the zip version in the BetterTweetdeck fork page.

Nevermind, found it:

  • First, install Firefox developer
  • Disable signed extension in about:config : xpinstall.signatures.required set on false
  • Load the extension in about:addons

@PRGilland
Copy link

When I install it on Firefox Nightly, I get this when I reload the tab, even though I'm still logged in when I get redirected:
firefox_2023-08-19_14-40-46

@Mara-Li
Copy link

Mara-Li commented Aug 19, 2023

I need to refresh a lot to get it works, on my side!

@archeruwu
Copy link
Contributor

If you get the login error, or it just doesn't load, refresh a few times.

@PRGilland
Copy link

I don't know how many "a few" is, but it's still not working. If this is something that has to be done every new session, It's probably not worth it for the time being

@archeruwu
Copy link
Contributor

Any way of getting legacy back is still better than dealing with "XPro" to be honest.

@LisandraBrave
Copy link

manifest.json lacks an add-on ID in "browser_specific_settings", meaning it will only install through about:debugging on firefox (even on nightly and developer), and won't install permanently.
However, reportedly chrome doesn't support the "browser_specific_settings" key and will show a warning if it's included. One possible solution is separate manifest.json per platform

@dimdenGD
Copy link
Owner

This is already done in pack.js

@LisandraBrave
Copy link

So it is. Must be some issue on my machine causing it then
image

@dimdenGD
Copy link
Owner

You can only install unsigned extensions on Firefox Beta/Nightly

@LisandraBrave
Copy link

LisandraBrave commented Aug 20, 2023

Does it not work on developer (which lists being on aurora update channel)?
Edit: It does, after restarting with all add-ons disabled, installing, and then re-starting, for some reason

@archeruwu
Copy link
Contributor

Anyone else getting near unusable lag after leaving the tab open for an extended amount of time? (Firefox Dev Edition)

@Fapo39
Copy link

Fapo39 commented Aug 21, 2023

still doesn't work for Firefox Nightly or ERS even with v2.02 while it works just fine for Chrome

@haxibami
Copy link
Contributor Author

haxibami commented Aug 22, 2023

In my case, v2 does not work on Firefox. <script> elements injected by element.innerHTML in injection.js are blocked by content security policy (CSP).

image

So I tried loading these scripts (bundle.js, vendor.js) as external files (element.src) - this time, they load fine, but the use of eval() in them violates CSP.

image

In any case, Content-Security-Policy header does not seem to be removed, despite the existence of the relevant code.

@haxibami
Copy link
Contributor Author

OK. Found the cause:

In Firefox, extraInfoSpec in browser.webRequest.onHeadersReceived.addListener only allows the values "blocking" or "responseHeaders" (or both) ,while in Chrome "extraHeaders" is also supported.

So we need some switching like this:

diff --git a/background.js b/background.js
index 235f726..d9ddd78 100644
--- a/background.js
+++ b/background.js
@@ -1,3 +1,11 @@
+const extraInfoSpec = ["blocking", "responseHeaders"];
+
+if (
+    chrome.webRequest.OnHeadersReceivedOptions.hasOwnProperty("EXTRA_HEADERS")
+) {
+    extraInfoSpec.push("extraHeaders");
+}
+
 chrome.webRequest.onHeadersReceived.addListener(
     function(details) {
         let headers = details.responseHeaders.filter(header => header.name.toLowerCase() !== 'content-security-policy' && header.name.toLowerCase() !== 'location');
@@ -6,7 +14,7 @@ chrome.webRequest.onHeadersReceived.addListener(
         }
     },
     {urls: ["https://tweetdeck.twitter.com/*"]},
-    ["blocking", "responseHeaders", "extraHeaders"]
+    extraInfoSpec
 );
 
 chrome.webRequest.onBeforeRequest.addListener(

@dimdenGD
Copy link
Owner

Thanks, I've updated repo and released new version

@Dajova
Copy link

Dajova commented Aug 23, 2023

Sorry for bringing this up, but it either seems broken again or it was just temporarily.

image

All i get is this (stuck on this page), even after clearing cookies, reinstalling the extension several times and refreshing the page once a minute for almost a hour. It worked the first time, but not once since then.

edit: nwm, it worked once i removed the login part of the url.

@Audrican
Copy link

You can only install unsigned extensions on Firefox Beta/Nightly

You can install it on main firefox as a "temporary extension" in about:debugging > This Firefox.
It'll uninstall upon closing but it's still an alternative for main fox.

@dimdenGD dimdenGD unpinned this issue Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants