erosman / support

Support Location for all my extensions
Mozilla Public License 2.0
170 stars 12 forks source link

[not an issue] FireMonkey: Two Simple Questions #90

Closed EstherMoellman closed 4 years ago

EstherMoellman commented 5 years ago

Hi @erosman !

Firstly, your add-on is fantastic! Thank you and congrats. The possibility to have all my CSS and JS scripts in one place, with a lightweight add-on... makes your add-on unbeatable. I discovered FireMonkey today, and I am still learning and testing, but I already love it.

I am not an expert, so please, I have two questions:

1) All my CSS and JS scripts have a delay. At AMO, you answered a similar question by saying: "You need to change the "run-at". By default it injects when everything is fully loaded.". So, I went to "FireMonkey - Help", read about "run-at", and sorry, but I didn't understand how to implement it. It seems I must use "run-at: document_start"... but where, how to use it? In brief, please: How can I make my CSS/JS' scripts to load instantaneously - without any delay? Why the FireMonkey default' mode doesn't do that automatically? For example, I use Dark Theme, and it is very bad to have first original webpage colors (whiteflash) and only then changing to my CSS' dark themes (at Stylus my CSS' scripts apply instantaneously). Same issue with JS' scripts, at FireMonkey they only work 1 or 2 seconds after the webpage loaded... bad. Please, how can I fix it?

2) I can't select/check the "Auto-Update" option. It seems an inactive/dead option. Am I doing something wrong?

Thank you in advance!

erosman commented 4 years ago

There are a few CSS that you can use like scaleor non-standard zoom but they are not exactly the same as the browser zoom.

EstherMoellman commented 4 years ago

... as usual, thanks @erosman for your answer. Yeah, I'm using a small CSS' code... here is the pastebin. It works, but is a kind of ugly. If by change you have something better, please share with me. Thanks!

erosman commented 4 years ago

It is not a good idea to use non-standard -moz-*

Use standard CSS

body {
  transform: scale(0.95);
}

Using specific tags/classes that only applies to some page for all pages is also not very useful.

A general tag like body would be sufficient

EstherMoellman commented 4 years ago

Hi @erosman !

I'm writing you here at GitHub because I have not other place to wish you the best of the best for 2020... always thanking you for all your fantastic endless teachings and helps... have a great 2020 to you and yours!

Big hug! : )

erosman commented 4 years ago

@EstherMoellman Thank you and Happy New Year to you too :)

EstherMoellman commented 4 years ago

Hi @erosman ! Please, let me bother you a bit (LOL). Out of topic, please can you take a look at these 3 scripts, and share with me your thoughts? They're very small scripts, and are not going to take you more than few minutes. They're scripts meant to open (all) links (always) in new tabs. Yeah, I know there are some add-ons for that. But don't ask me why, the scripts here I'm asking you to check, at FireMonkey they seem to have less negative browser performance than add-ons. Of course, I'm an ignorant at JS, so please, I would like your opinion: Are these scripts efficient? Secure? Able to be improved? Etc?

Thanks a lot in advance!... hoping you are already recovered from the end of the year parties (LOL)

Big hug! : )

Script 01

Script 01 version 2

Script 02

EDIT: @run-at should be document-end

erosman commented 4 years ago

Add-on vs Script:

Script 01 Simple script, works better as user-script here is the same one, made a bit simpler.

/*
==UserScript==
@name               External Link Taber01
@match              *://*/*
@version            1.0
@run-at             document-end
==/UserScript==
*/

[...document.links].forEach(item => item.target = '_blank');

Script 01 version 2 Look above, it is the same script and doesn't do anything extra

Script 02 Again simple script, here made a bit simpler

/*
==UserScript==
@name               External Link Taber03
@match              *://*/*
@version            1.0
@run-at             document-end
==/UserScript==
*/

document.querySelectorAll('a[href^="http"]').forEach(item => item.target = '_blank');
EstherMoellman commented 4 years ago

THANK YOU!... as usual, you always so helpful... thank you indeed.

Yeah, I never forgot your teachings, including the difference between add-ons VS scripts. But sometimes there is no logic, perhaps due to Firefox' bugs, I don't know... but sometimes I see add-ons doing better when are expected to do worse (and vice-versa)... the same goes for scripts, userChrome etc. I don't have the knowledge to explain why this happens, but it happens. And time ago I shared with you my findings, for example comparing FireMonkey VS userChrome, scenario where userChrome was expected to be better than FireMonkey, but not, FireMonkey was much better. Anyway, I stopped to try to understand why some things happen (when are not expected to happen), and I started to trust my experiments (less intellectual and more empirical). Add-ons, scripts, userChrome etc, today I use just what the experiment shows me to be better. However, I always like to double-check my decisions with those guys that really have strong knowledge (you), just to be sure I'm not doing something wrong.

Please, last two questions:

1) You kindly sent me two simpler versions of the link to new tab script. Do you have any comment if one version is better than the other?

2) Here is a different script, also very small, it is expected to skip ads in videos. Please, do you have any comment?

Thank you once again!

erosman commented 4 years ago

Do you have any comment if one version is better than the other?

They are similar. Script 1 will affect ALL the links while script 2 will only affect the non-relative links.

Performance is almost the same. It all depends on what you want to change and what you want to keep.

Here is a different script, also very small, it is expected to skip ads in videos. Please, do you have any comment?

There doesn't seem to be a problem.. although I don't know how effective it is in practice.

EstherMoellman commented 4 years ago

... thanks again! Yeah, after testing I saw script 1 affecting more links than script 2. But despite the fact that script 1 covers lot of links, it doesn't cover "ALL" links. For example at GitHub, links with titles are covered by script 1, but many other links are not covered and they open on same page. Same with Facebook etc. Any chance with script 1 to open ALL links (100% of the links) in new tab?

erosman commented 4 years ago

it doesn't cover "ALL" links

There are 2 points to consider: