FB - Clean my feeds

Hide Sponsored and Suggested posts in FB's News Feed, Groups Feed, Watch Videos Feed and Marketplace Feed

< 腳本FB - Clean my feeds的回應

評論:正評 - 腳本一切正常

e41
§
發表於:2024-05-16

I have dark mode active in Facebook and I cannot read the settings panel of this script.
How can I solve it?

zbluebugz作者
§
發表於:2024-05-16

Works Ok if I use FB's dark-mode (Display & accessibility > Dark mode : On).

What are you using to enable dark mode?

e41
§
發表於:2024-05-16

I have it in automatic.

e41
§
發表於:2024-05-16

I think that this part of the script:

        if ((VARS.Options.CMF_DIALOG_BG_COLOUR === '') || (VARS.Options.CMF_DIALOG_BG_COLOUR === undefined)) {
            addToSS('.__fb-light-mode .fb-cmf', 'background-color:#fefefa;');
            addToSS('.__fb-dark-mode .fb-cmf', 'background-color:var(--web-wash);');
            addToSS('.fb-cmf', 'background-color:floralwhite;'); // -- fall back colour.
        }

should be altered to this:

        if ((VARS.Options.CMF_DIALOG_BG_COLOUR === '') || (VARS.Options.CMF_DIALOG_BG_COLOUR === undefined)) {
            addToSS('.__fb-light-mode .fb-cmf', 'background-color:var(--web-wash);');
            addToSS('.__fb-dark-mode .fb-cmf', 'background-color:var(--web-wash);');
            addToSS('.fb-cmf', 'background-color:var(--web-wash);'); // -- fall back colour.
        }
zbluebugz作者
§
發表於:2024-05-16

The line of code addToSS('.fb-cmf', 'background-color:floralwhite;'); // -- fall back colour. is designed to apply a fallback colour, only when the classes __fb-light-mode and __fb-dark-mode are not present.

Can you grab a piece of the HTML code from FB, please.

1) Visit Facebook in your web browser.
2) Right-click anywhere on the page and select "Inspect" from the context menu.
3) In the Developer Tools window that opens, navigate to the "Console" tab.
4) Enter the following JavaScript code snippet in the console: document.head.parentElement
5) Copy the results displayed in the console and paste them here.

The HTML code you provide should resemble something like this: <html id="facebook" class="_9dls __fb-dark-mode" lang="el" dir="ltr">.

Also, let us know what browser and operating system you're using.

e41
§
發表於:2024-05-16

The code is huge (1.3M characters) and it cannot be pasted here!!!!
I am using Google Chrome and Windows 11.
I have altered the script as I said before and tested it in all three modes (Light, Dark and Automatic) and it seams that it works with all of them.
:-)

zbluebugz作者
§
發表於:2024-05-16

Sorry, didn't realise Chrome behave differently from Firefox and dumped all of the page's HTML code instead of the one line that we needed ...

Try this Javascript code snippet: '<'+ document.head.parentElement.outerHTML.split('<')[1]

e41
§
發表於:2024-05-16

<html id="facebook" class="_9dls" lang="el" dir="ltr">
That's what it gives
:-)

zbluebugz作者
§
發表於:2024-05-16

Thanks for the feedback.

For some reason, you don't have the light/dark classes in the tag.

Good to see you have a fix that works for you. You might want to disable the automatic update ...

I'll have to spend a bit of time looking into this.

Will let you know when the next release has been published.

e41
§
發表於:2024-05-16

From what I have seen in the Facebook code there are some JS scripts that detect the current OS setting (Light or Dark mode) and give the respective value to the "web-wash" css variable.
Maybe if you use this css variable, it will do the trick.
Also, as a suggestion, it would be better if the translations were per language and not per KEY, as you have them.
This way, the translations can be better manageable, if someone wants to contribute.
Keep up the good work.
:-)

發表回覆

登入以回復