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 5 years ago

Thank you for your kind comment.

run-at

Unlike GreaseMonkey (and ViolentMonkey) which defaults to 'document-end', the Firefox content_scripts default run-at is 'document_idle' and FireMonkey conforms to the Firefox API default (and so does TamperMonkey).

That means, there is no need for event listeners such as load or DOMContentLoaded as they will not apply. If script has to run earlier, then the run-at has to be set accordingly.

GreaseMonkey uses hyphen separated words (document-start, document-end, document-idle), while the API uses underscore separated words (document_start, document_end, document_idle). FireMonkey converts the hyphen so both can be used.

extensionTypes.RunAt Values of this type are strings. Possible values are: "document_start", "document_end", "document_idle".

"document_start": corresponds to loading. The DOM is still loading.
"document_end": corresponds to interactive. The DOM has finished loading, but resources such as scripts and images may still be loading.
"document_idle": corresponds to complete. The document and all its resources have finished loading.

The default value is "document_idle".

It is important to understand the difference in order to set the correct option.

CSS: CSS rules override previous rules. That means that last rule gets the priority. For example of there are 2 rules for the same thing.

<link rel="stylesheet" href="remote.css"> body { background-color: white; }

inline CSS <style> { background-color: blue; } </style>

The one that loads last, will be used so the background-color will be blue. It is possible to set !important but if both have it, then the last one will be applied.

If the new CSS is injected before page CSS, there is a chance that the page CSS will override it.

Therefore, the best option is "document_idle" which means after everything else has finished loading. Of course, you will see the original unchanged page as it is loading so the there is a delay until the CSS is applied.

The next best option (like the default in GreaseMoneky) is "document_end". That means once the DOM is loaded but remote content (remote JS & CSS) may be still loading.

There is very limited cases to use "document_start" e.g. for changing the URL or page JS before it loads or apply strict CSS and hope nothing overrides it.

How to set run-at****

FireMonkey accepts both GM style run-at and MDN API style runAt

Example:

/*
==UserCSS==
@name          Dark
@matches       http://example.org/*
@author        erosman
@version       1.0
@run-at        document-end
==/UserCSS==
*/

background-color: #000;

As the default run-at is "document-idle", @run-at is only needed if you want to change it to "document-end" or "document-start".

JS It is a similar case with JS scripts. Depending on when the best time it is to inject the JS, run-at has to be set accordingly. For example, many pages use JS to generate the page. If you want to change the DOM, you have to wait for the JS to load first and then inject new script via FireMoneky.

Auto-Update

Update & Auto-update

Any target can be set for @updateURL as long it directly leads to the final file and it is in plain text. The .js or .css file extensions are not necessary although it makes sense to have them. The .user. is not necessary.

FireMoneky uses @version for the update process and both the current file and the update file must have @version and the version of the target file must be higher.

Does the script/CSS have both @updateURL and @version?

EstherMoellman commented 5 years ago

Hi @erosman ,

Your explanation was more than perfect! Thank you and sorry once again for my low newbie level.

So, I tested all the possible variants, using "document-start" or "document-end" etc, with one blank space or lot of blank spaces, in the beginning of the script or at the end, you name it, lot and lot of different possibilities, and zero, it makes no difference, I still have a delay. It doesn't matter how or where I place the "@run-at document-X"... I always have a delay. This happens also at JS' scripts. It is a small delay, but is clearly visible. At JS' scripts the delay is tolerable, but for CSS' scripts is unfeasible (because it causes a big bad impression when a script is showed with "X" color at the beginning, and "Y" color 1 second after).

I tested on FF' Nightly clean install, without any other add-ons, scripts, not even chrome folder, zero, nothing, Nightly totally clean. And the CSS' scripts I use, all work perfect at Stylus, no delays, all CSS' scripts are applied instantaneously.

This frustrates me, because I really want to leave Stylus, and to move everything I have to FireMonkey. As I said, I find FireMonkey perfect for me. But I don't know if I am doing something wrong, or the delay is a normal behaviour for FireMonkey, or if it is a bug etc. So, it will be fantastic if you can help me here.

If the delay is a FireMonkey' normal behavior, it will be a killing confirmation for me, because I won't be able to use FireMonkey. In this case, please feel free to close this issue.

Thank you in advance!

erosman commented 5 years ago

Stylus is injecting the CSS using a different API and not as content CSS (or JS).

The behaviour is different. Stylus also injects at "document_start" and also "all_frames": true,

If you give me an example of the CSS and the target page, I will test to see what can be done.

EstherMoellman commented 5 years ago

@erosman ... I hope to be the problem! (LOL)... yeah, my wish is to be wrong, doing something wrong, a mistake etc, perhaps due to my low-level-user, lack of knowledge etc. I hope you can find a way where finally I can use FirefoxMonkey without delays... I do really love your add-on... I do really want to move everything to FireMonkey... so thank you!... thank you in advance for your time and patience... thank you for your tests:

Below I attach you two scripts, where I am experiencing delays. One is a JS' script, and the other one is a CSS. I attach the original scripts, but I tested them at FireMonkey with all the combinations possible. They both work at FireMonkey, but they both have delays. This is happening to me to almost every JS or CSS' script I use at Firemonkey:

Example of JS' script: https://greasyfork.org/en/scripts/40897-old-reddit-please https://pastebin.com/pUD86bcF PS: You can see this code already has "@run-at", and even with that, I have a delay.

Example of CSS' script: https://userstyles.org/styles/136318/clear-dark-facebook-by-book777 https://pastebin.com/3Ef67NpD PS: CSS' scripts are my big problem, they kill all my dark themes at FireMonkey with the initial delay.

erosman commented 5 years ago

Sorry.. there seems to be a typo in the code..... I am investigating.

erosman commented 5 years ago

That was it .... there was a typo in the code the prevented the run-at from being applied .. sorry about that

I will upload a new version with the fix very soon.

erosman commented 5 years ago

v1.10 uploaded

try now .. with


/*
==UserCSS==
@name          Clear dark facebook by book777
@matches       https://www.facebook.com/*
@author        Nicholas Buk
@version       190823.2
@run-at        document_start
==/UserCSS==
*/

/*
    Author: Nicholas Buk (book777 / nikolia0612)
        m.me/489734454703065
    Page: https://userstyles.org/styles/136318
    Version: 190823.2
*/
  :root, .__fb-light-mode
  {
....
EstherMoellman commented 5 years ago

... ohhhhhhhhhh yeahhhhhhhhhhhhhh... this is f@king good (excuse my french - LOL) !!!!!!!!!!!!!!!!!!!!

I did a super quick test with the two scripts I sent you, and it seems to work. I need to do more tests, a lot of tests. But it will take me some time, I can't test now. I will be back here, sharing with you my results.

But Man, at first glance, it seems to work... I can't explain you my happiness : )

If after my tests I confirm that the @run-at works... it will be fantastic! Your add-on not just will save me the Stylus resources, but also will save the resources consumed by other JS' scripts exe addon.... less RAM, less CPU, less battery, less heat, less etc... Man, you're a genius LOL...love you! : )

EstherMoellman commented 5 years ago

@erosman , in order to do my tests, please allow me few further simple questions:

a) If I import my Stylus CSS' scripts, FireMonkey separates each scrip in several parts (seems to me depending on "@matches"). For example, a Youtube CSS' Dark Theme, when imported by FireMonkey from Stylus, it will be separated in 8 parts, with 8 different names (Youtube1, Youtube2 etc). Is there a way to import without separating in parts? (everything under the same root script).

b) Same question for userstyles.org: Which one will be the most efficient way to install a CSS' script at FireMonkey, when the script has several different "@matches", but we want everything under only one root script? (for example, a Youtube' CSS script, everything under only one script named "Youtube").

c) Based on your experience, which will be the best way to migrate all my scripts into FireMonekey: By importing everything from Stylus etc? Or by installing one by one from the scratch, using the original script sources?

d) In terms of future performance efficiency (RAM, CPU etc), what way is better: To import 1 script from Stylus, that will be separated at FireMonkey in 20 scripts? Or to manually create only one script with several "@matches"? Where the browser will be less negative impacted in performance? In other words: Which will be the best way (in terms of browser performance) to install a script?

d) Future Feature - Suggestion: I have lot of scripts, and to manually need to add the "@run-at", one by one, it is pretty time consuming, specially in the case I mentioned above, where I imported my scripts from Stylus, and now I have more than 100 separated scripts at FireMonkey. So, for this case, I suggest a future feature, an option allowing the user to decide if he wants "@run-at document-start" as default.

erosman commented 5 years ago

a) Stylus can handle multiple patterns into one file. They can even be multiple sites. That makes it complicated to auto-convert them. For example:

@-moz-document url(http://www.example.com/test.html) {
  body { background-color: black !important; }
}

@-moz-document url(http://www.example2.com/test.html) {
  body { background-color: green !important; }
}

It is not possible to combine those into 1 CSS since they apply to different sites with different rules.

However, it is often possible to manually edit them and combine some. It is a pain and the Stylus conversion, as I had said, is not perfect.

b) As above.. if they apply to the same site, it is possible to combine them. If some sections apply to some site and some section to another, it is not possible.

c) I, myself, imported mine from Stylus thus creating multiple CSS. In fact I wrote the import just for that reason and had to break them into multiple files since I was forced to. It is possible to check them later and manually combine the ones that would be possible to combine.

d) Generally speaking, 1 is better than many, whenever possible. However, the impact is not that great on modern computers and browsers, especially for CSS. Stylus & Stylish also have to break the same file into segments and insert them to the correct location separately, so there is no performance loss in that regard with multiple files in FireMoneky.

e) I have been thinking about doing something about it... but I need to work on it and test it more. While "@run-at document-start" could be good for CSS, I have maybe 1 JS (out of 100s) that needs to be inserted that early. Maybe I would set the Stylus import to auto set as "@run-at document-start" !!??? Or Maybe ... I created a multi-select multi-set edit option for "@run-at document-start" !!!?? so you can select 10, 20 etc CSS and set them all in one click !!??

erosman commented 5 years ago

I am going to set the default for Stylus import to "@run-at document-start" for the time being and release a new version tomorrow. So, you can do it tomorrow.

EstherMoellman commented 5 years ago

@erosman , thanks for the answers/explanations.

e) The JS' script I attached you today, needs "@run-at document-start". I don't really have enough experience here, but from my ignorance, it seems that a "@run-at" option also might be welcome for JS (not just CSS). I don't exactly remember, but I think I saw this option at ViolentMonkey or similar. Average-users (like me), JS' ignorants, they may confront JS' scripts having delays, and they may abandon FireMonkey because of that. So, is your call, if it is easy to be included an option for CSS & JS, perhaps is a good idea to include. I'll wait your next version with the Stylus' import option (thanks a lot!). In some way, I hope I'm helping you a bit to make FireMonkey even greater with some cool improvements.

f) New question 01: You said "Stylus uses a different API". Why FireMonkey doesn't use same API? Which one is better or worst for browser performance?

g) New question 02: Why Stylus doesn't have JS' functions as FireMonkey has? Is it better to keep both functions (CSS/JS) separated? I'm trying to understand here, why Stylus chose not to include JS' scripts (due to some browser performance reasons?), or perhaps the API Stylus uses is better for CSS but worst for JS? If this is the case, why FireMonkey doesn't use the same Stylus API uses for CSS? Why we don't see add-ons like FireMonkey, allowing CSS and JS? Why add-ons prefer to keep functions in separate? I'm falling in love with FireMonkey, so before moving all my tons of scripts, I want to understand if I will lose something... the main reason I want FireMonkey, is for improving browser performance... but all add-ons are separating CSS from JS, so no one better than you to help me understand if FireMonkey will give me or not browser performance gains. Also I ask you, because I am a member of a small "FF' club" (150 members), we love to share FF' customizations/hacks, and I want to be sure to recommend FireMonkey to all the members.

erosman commented 5 years ago

v1.11 uploaded

Stylus Import sets run-at to document-start
Import Preferences now updates the Script/CSS display

I will answer the rest of your question later.

erosman commented 5 years ago

e 2) That JS changes the page URL and therefore requires to be injected at document-start Such scripts are maybe 1% of all scripts. Most JS deal with DOM and wont work if inserted at document-start

f) FireMonkey uses slimmer code and dedicated API which has much better performance. Stylus has to split each CSS into segments and inject them separately.

g) One of the reasons I wrote FireMonkey (for myself initially) was the fact that I could do both JS and CSS at the same time using one extension with much slimmer code. Others have been doing CSS or JS exclusively for such a long time that is very difficult for them to change the entire code. They are still using older API which also makes it difficult to change.

AFA performance, just compare FireMonkey volume of code with a CSS extension plus a JS extension added together. You will see FireMonkey code is a fraction of those combined. More JS code means more processing, more CPU usage, more memory usage.

For example: greasemonkey-4.9-an+fx.xpi (529kb) + stylus-1.5.5-fx.xpi (1.34mb) = 1.869mb firemonkey-1.11-fx.xpi = 62kb (that is about 3% of above)

Additionally, FireMonkey is the only extension currently using the latest API with has many security benefits in addition to performance benefits.

EstherMoellman commented 5 years ago

upssssssss... "Houston, we may have a problem" LOL... V1.11 imports scripts from Stylus, inserts "@run-at" (thank you!), but scripts have a delay. It seems that "@run-at" is ignored. However, I discovered that when I manually change your "-" between "document" and "start", voilá, it works without delay. I don't know if it is an issue with your typo: "-", or if it is something else. I tested in two different computers, and the same happens.

PS: Thanks for your answers.

erosman commented 5 years ago

Oops... You are right.. I rushed it... I will fix that and upload a new version

v1.12 uploaded

erosman commented 5 years ago

Also I ask you, because I am a member of a small "FF' club" (150 members), we love to share FF' customizations/hacks, and I want to be sure to recommend FireMonkey to all the members.

If you want to share the same scripts/css then you can tidy them up and then others can get them using one of these methods:

  1. export them and then share them so others can import them (individual JS CSS files)
  2. you can save the Preferences and then others can Import the Preferences (which includes all JS/CSS)
EstherMoellman commented 5 years ago

Hi there @erosman !... haven't fully tested, but V1.12' preliminary test seems OK... thanks and congrats! This was a small improvement, but very helpful indeed.

Please, one more suggestion: When FireMonkey imports scripts from Stylus, but without "@matches" ("appllies to" in Stylus' semantics), FireMonkey ends presenting these scripts as "wrong" or "incomplete" etc, and these scripts remain inactive at FireMonkey (until "@matches" is filled). I believe this is done by propose at FireMonkey, in order to alert users to fill "@matches". And if I am right, this is good, is fine, avoids empty "@matches". However, when we import a CSS' script, and "@matches" or "applies to" are empty, usually means that this script is universal, not wrong, not incomplete, just applying to everything. Don't you think in this case, when a script is imported, and "@matches" or "applies to" are empty... don't you think will be useful if FireMonkey by default replaces empty "@matches"/"applies to" with universal ones? The case is similar to "@run-at". At Stylus I have tons of scripts with empty "applies to". And when FireMonkey imports them, I have a lot of work by having to manually complete "@matches", one by one, each script. I believe FireMonkey can assume (when importing) that an empty "@matches" or "applies to" means universal, applies to everything. What are your thoughts?

PS: Thanks for the tips about sharing same scripts. Our process is similar to FF: Normally, be have a kind of master FF' dummy (in a private repo), containing all the add-ons, hacks, customizations, settings, preferences, updates and upgrades etc... users (members of the "club") download this FF' dummy, but personal-files (like permissions, passwords, session, places etc) are preserved at each profile. So, our FF' dummy will contain FireMonkey with all the Stylus' scripts already imported, and users (members of the "club") will be ready to go, plug-and-play, nothing to be done from their side. However, when I make a suggestion to you, I never have my "club" in mind. I always suggest improvements thinking in all FireMonkey' users. You have a gem! And it will be nice to see FireMonkey improving and improving, while keeping its core added-value: Lightweight, Simplicity, Minimalism etc. And in my opinion, as long as more and more users adopt FireMonkey, they will help you more and more with potential great ideas.

erosman commented 5 years ago

when we import a CSS' script, and "@matches" or "applies to" are empty, usually means that this script is universal,

Where is the documentation for that? ref: Applying styles to specific sites

FireMonkey can only partially convert matches in Stylus. It can not convert @-moz-document regexp('example') and therefore leaves them blank.

EstherMoellman commented 5 years ago

@erosman , independently on documentation, and from a pragmatic point of view, I would say that is a fact: At Stylus, if you have an empty "@matches/applies to"... the script will be universal, applied to everything. Same happens at "userChrome/userContent" folders, any CSS' script without "@matches/applies to", automatically will be applied to everything. I'm not saying this is a "correct" or "incorrect" procedure. I'm just describing a fact.

At FireMonkey, if an user is working in a specific new CSS' script, I think is a good idea FireMonkey alerting about empty "@matches". But, when a CSS' script is imported, and "@matches" is empty, I believe FireMonkey (by default) should assume the user wants an universal "@matches". It is just my personal opinion.

You said FireMonkey can't import "applies to" with REGEX. OK, this is a FireMonkey' limitation, and we must live with it. But if "applies to" is empty, my humble ignorant opinion is that FireMonkey by default should assume "@matches" as universal (not blank). It is just a suggestion! :)

erosman commented 5 years ago

REGEX Patterns
Most of the time, the REGEX patterns can be converted to normal match patterns but it cant be done automatically.

Blank Patterns It can lead to problems, especially since it is not documented feature. Inserting into every document is costly in term of performance and should be attempted only when absolutely necessary. However, it is easy to do it yourself in any text editor before importing into FireMonkey. Just open the stylus backup JSON with a text editor and for example replace "urlPrefixes": [] with "urlPrefixes": ['*://*/']

Additionally, there should only be ONE css if it is going to be for ALL pages and manually fixing that one should be easy.

EstherMoellman commented 5 years ago

... @erosman thanks for the answers... yeah, I already by myself discovered that making some editions before exporting to FireMonkey, may solve lot of little issues. Perhaps all your nice explanations in this long conversation we had here, it will be nice to be added to your "FireMonkey - Help", I'm sure it will be extremely helpful for many other future FireMonkey' users, specially those (like me) without know-how, or those using Stylus etc. Very, very useful your explanations.

With regards to REGEX, I'll make some tests, but just to be clear, I wanted to ask you: a) FireMonkey doesn't import any REGEX? Every REGEX at FireMonkey appears blank/empty? b) How to automatically convert a REGEX into normal pattern? Does FireMonkey do that? c) You shared with me lot of useful tips to export scripts from Stylus into FireMonkey. Do you have any specific tip about REGEX at Stylus before FireMonkey? d) Normally REGEX may hurt Stylus' performance. So I try to use REGEX only in last case, and for very specific needs. FireMonkey with the new API (different from Stylus etc), have you tested REGEX?, do you have any info about FireMonkey + REGEX and performance? (RAM, CPU etc)

erosman commented 5 years ago

a) FireMonkey doesn't import any REGEX? Every REGEX at FireMonkey appears blank/empty?

Correct

b) How to automatically convert a REGEX into normal pattern? Does FireMonkey do that?

Only manually... You need knowledge of RegEX If you post them, I will try to help you out.

c) You shared with me lot of useful tips to export scripts from Stylus into FireMonkey. Do you have any specific tip about REGEX at Stylus before FireMonkey?

Sadly, no... refer to above

d) Normally REGEX may hurt Stylus' performance. So I try to use REGEX only in last case, and for very specific needs. FireMonkey with the new API (different from Stylus etc), have you tested REGEX?, do you have any info about FireMonkey + REGEX and performance? (RAM, CPU etc)

FireMonkey uses the new Firefox API and that API only supports Match Patterns. RegEx is not supported by the API (although Globs are supported).

Older Style/Script manager inject manually which is not as efficient (or secure) as the new dedicated Firefox API.

EstherMoellman commented 5 years ago

... oh boy... these are bad news for me. Before asking you, I was afraid of your answers, but I preferred to ask you with the hope that I was wrong, or you will have some workaround. But not, now is clear: FireMonkey doesn't accept REGEXPs at all... life is cruel (LOL). Anyway, thanks for your answers.

I'm a little lost now. Most of the CSS' scripts have REGEXPs. And yeah, today I can abuse from your help and covert some of my REGEXPs. But what about tomorrow/future? I can't abuse from you all the time. And on a second reading of your comment, you said "cant be done automatically", but I realize that wrongly originally I read ""can be done automatically"... my bad! You already were clear on your previous comment. So in brief: I'm f@ked (excuse my french - LOL).

Well, let's live one day at a time, first things first, here are some of my REGEXPs (https://pastebin.com/hG4Ay6CC), please do whatever you can/want to do, when/what you can/want to do etc... any help will be more than welcome.

But even more important: Unfortunately, I do not have time to learn how to convert REGEXPs. And I can't abuse from you all the time. Do you believe on a workaround for FireMonkey in order to be able to deal with REGEXPs? Any light at the end of the dark REGEXPs' tunnel?

erosman commented 5 years ago

Personally, for someone who uses 100s CSS all the time, I never had to use RegEx for their match.

The Firefox API does not support RegEX and it is not in my hands.

Other extensions do it manually which adds a GREAT deal of overheads.

It is not worth the hassle when 99.99% of the time the normal match does it nicely. Previously, that was the only option so extensions did it that way. Now there are better options.

AFA your examples..... some of them are easy to convert and even better to convert Who has written them and why they have used RegEX in the first place? What is this?

Facebook by book777

http(s?)://(www.|)facebookcorewwwi.onion(.*)

This is not facebook 'facebookcorewwwi.onion'

What is this? this can catch a lot of other places

IMDB

(?=.*?api_key=127059960673829).*

Lets look at one... for example:

ANTI-WHITEFLASH

http[s]?://(?!(imdb.com|facebook.com|github.com|miradetodo.co|www.google.com)).*

Above is the same as the following (which is even easier to understand)

// match      *://*/*
// exclude    *://imdb.com/* 
// exclude    *://facebook.com/* 
// exclude    *://github.com/* 
// exclude    *://miradetodo.co/* 
// exclude    *://www.google.com/* 
EstherMoellman commented 5 years ago

I totally understand you! But please remember, you say what you are saying, only because you already have the knowledge, both, REGEXPs and normal match patterns. Even those guys that supposedly know REGEXPs, per your own words, they don't exactly know why/how to use REGEXPs. So, average-users (like me) have no chance to identify what is a good REGEXP, a bad one, when can perfectly be replaced by a normal match pattern etc. This is real world.

For example, at https://userstyles.org/styles/136318/clear-dark-facebook-by-book777 and at https://userstyles.org/styles/98447/imdb-com-nightmode, you will see the two first REGEXPs you questioned in your previous message. In real world, users (like me) go to https://userstyles.org/, they install the CSS, and c'est fini, end of the story. The same at https://greasyfork.org. Most of the users never questioned nothing. It's wrong? Yeah! But this is real world, and is impossible to learn everything all the time. So, 'trust" takes place. I trust, because I don't have the knowledge! And my behavior has pluses and minuses. The minuses are what you pointed: Users sometimes use wrong stuff.

I repeat my logic:

So, sorry for asking again: Is this the end of the road for me? Or hope never dies? Is there any solution for my REGEXPs?

erosman commented 5 years ago

userstyles.org is becoming cumbersome as it blocks some IPs and then has a captcha as it tries to track users with all sorts of JS.

Anyway ...........

When Stlyish started, they APIs for Firefox were completely different and the possibilities were also different. The were no dedicated API to inject script or CSS and everything had to be done manually. Even the method of using @-moz-document domain('images.example.com') etc were very specific to the Firefox of the time. It is still marked as 'experimental technology' which means they may be removed anytime.

At that time, the 'Match Pattern' was not available. 'Match Pattern' was introduced LONG time ago. I cant recall when, but FF41 (2015-06-29) had it.

As Firefox and technology developed and new APIs became available (even before FF57 Quantum), many extensions did change to use the improved technology, and many didn't. Some eventually were forced to use the new technology and some continued to use the old technology by going the long way to avoid the change.

When would backward-compatibility become an obstacle to advancement?!

Script/CSS writers also could have (as many did) use the improved APIs but alas many didn't.

Subsequent extensions such as Stylus also continued the same set-up as Stylish without change.

It is the same with GreaseMonkey. When new improved @match API introduced by GM, script writers still continued to use the old (less powerful/versatile) @include. GM code has not changed greatly from the old GM and some changes introduced in GM4 were forced due to lack of API.

Originally, I was concerned about the direction extensions were taking so I wrote FireMonkey for myself and for my own use (I still have many extensions that I only use personally and never been released publicly). It was later that I decided to release FireMonkey, in case some people might find it useful.

The new APIs are dedicated API which are more efficient and more secure. Bypassing the API and/or circumventing it, introduces security and performance issues. 'Match Pattern' was introduced to help script/CSS writers as well as users.

*://*/*.jpg is a lot easier to use and understand than/^https?:\/\/[^/]+\/.+\.jpg$/

The problem is that people still opt to use the more difficult approach. I have been a heavy user of user-scripts and user-styles for over a decade with 100s of them running all the time and I have never had to use RegEx. It is easy enough for the script/CSS writers to change and update their script/css if they chose to do so.

I recall the arguments of Digital vs Analogue when digital recording was introduced (I am in my 50s). The backward compatibility and pros and cons were discussed ad nauseam.

I wonder how many would now opt to listen to and carry cassette Walkmen instead of mp3 on their mobiles!?

Finally, a practice becomes common place when more and more people opt to use it. Nothing starts as being common practice. ;)

EstherMoellman commented 5 years ago

@erosman thanks for your wonderful explanation... but you don't need to convert me (LOL)... I already saw the light (LOL)... I'm already a FireMonkey' believer (LOL)... you can jump this stage with me (LOL). I am in my 25s, but I already knew many of the things you mentioned in your previous comment. And yeah, I totally agree with you. I don't care about what the majority of the users/devs do. I just care about what works better. I'm not a cow following the herd. I'm a pragmatic/functionalist girl. And this is exactly why I'm a member of my small "FF' club", because we don't like the "default dictatorship", we like customizations, hacks, personal stuff etc. I am already in love with FireMonkey, and can't see myself back to similar add-ons.

In this context @erosman , instead of "why I should do things", I need the "how". I don't care about REGEXP! F@ck REGEXP! But Man, I need to deal with me present REGEXPs... please, understand me. It's a pragmatic issue. Also, I need to deal with future REGEXPs, because unfortunately, most of the programmers still use REGEXPs.

I don't expect from you to solve all my life now. But at least, if I can convert the list of REGEXPs I sent you days ago... this for me will be the first step toward the solution. So @erosman , what can I do? How can I convert the list of REGEXPs I sent you? Is there a software that can help me to convert REGEXPs into NORMAL PATTERS? Or some sort of online editor/converter webpage? Etc? This is the kind of help I expect from you. And if there is a way to convert my REGEXPs into NORMAL PATTERN, please share this info inside FireMonkey' help. I'm sure lot and lot of future users (like me), without knowledge, will find extremely useful all the info you shared with me in the commentaries here above. I'm your laboratory-guinea-pig (LOL), most of future FireMonkey' users will have the same difficulties I'm having now, and if they don't find an answer at FireMonkey' help, they may abandon FireMonkey.

Please, help me to solve the REGEPXs' issue, starting with my present REGEXPs' list. If sadly nothing can be done, OK, then this will be the end of the road for me. But, if I can start by solving my present REGEXPs' list, then this will be my first step into the solution. In fact, this is the last step I need to solve, in order to completely move all my CSS/JS into FireMonkey. Yeah, I have lot of questions/suggestions about different FireMonkey' stuff. But now, the only thing stopping me to move completely into FireMonkey, is that I need at least to solve my present REGEXPs' list.

By the way and changing subject, if you are interested in promote/divulge FireMonkey, please allow me a suggestion: Go to (https://github.com/ghacksuserjs/ghacks-user.js/issues/796). Introduce yourself as FireMonkey' Dev. Offer yourself to answer questions. As you may know, today FireMonkey is the only real open source (ViolentMonkey' privacy policies are debatable). So, Firemonkey not just is more lightweight, performance efficient etc, but also nowadays, FireMonkey might be the most privacy/security friendly. So, it will be nice to promote that. In parallel, I sent an email to https://www.ghacks.net/. They are not top reviewers, but Firefox' users like them a lot. So, I invited Martin to review FireMonkey, and I described (as much as I can) the FireMonkey' strengths. You said: "a practice becomes common place when more and more people opt to use it."... and I can't agree more with you. But first, we need more FireMonkey' users! So, we need to promote/divulge etc FireMonkey, as much as possible. As long as more and more users "see the light" (LOL), and they become FireMonkey' believers (LOL), 3 great thinks will happen: a) You will receive a lot of new suggestions to improve FireMonkey b) You will receive help c) It will be easier to help other new users (like me) with REGEXPs etc, because the future FireMonkey' community will be able to help new users. So @erosman ... let's spread the FireMonkey' word (LOL)!

Big hug! : )

erosman commented 5 years ago

How can I convert the list of REGEXPs I sent you? Is there a software that can help me to convert REGEXPs into NORMAL PATTERS? Or some sort of online editor/converter webpage? Etc?

Sadly, no. My suggestion is: You have a CSS and somewhere (e.g. in description) it should say which sites it applies to. It is easy to learn 'Match Pattern' (read MDN or the FireMokey help). YOU can write them match pattern yourself.

For example:

/***** Fixes facebook comments on imdb news articles *******************/
@-moz-document regexp("(?=.*?api_key=127059960673829).*")
{
  .plugin .pluginSkinLight
  {
    color: #ccc;
  }

  .plugin .pluginSkinLight .UFIInputContainer span
  {
    color: #000;
  }
}

I dont know where it shows but probably the following would do it (although it is better to be more specific and limit it to a domain) @match *://*/*?api_key=127059960673829*

In parallel, I sent an email to https://www.ghacks.net/. They are not top reviewers, but Firefox' users like them a lot. So, I invited Martin to review FireMonkey, and I described (as much as I can) the FireMonkey' strengths.

Thank you .... I saw it :) FireMonkey uses Firefox's official API for userscripts and userstyles

As I have mentioned in other topics, FireMonkey is in its early days and it is still developing based on user feedback.

I will post a few that I have converted in the next post... maybe do some more later Update: completed

erosman commented 5 years ago

Facebook by book777

http(s?)://(www.|)facebookcorewwwi.onion(.*)

// this is only needed for Tor user
@match              *://*.facebookcorewwwi.onion/*

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

GitHub Dark

^https?://((gist|guides|help|lab|launch-editor|raw|resources|status|developer)\.)?github\.com/((?!generated_pages/preview).)*$

^https://www\.zuora\.com.*github\.com.*$

@match              *://*.github.com/*
@excludeMatches     *://*.github.com/generated_pages* 
@excludeMatches     *://*.github.com/preview* 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Google Darkest Fusion

(https|http)://(www|keep|drive|finance|policies|accounts|notifications).google.(com|([a-z]{2}))(.[a-z]{2})?/(?!mobile|music|adsense|community|voice|android|fonts|apps/publish).*

(https|http)://(www||images|appengine).google.(com|([a-z]{2}))(\.[a-z]{2})?/(?!mobile|adsense|community|voice|android|advanced_search|fonts|signin|.*._/notifications).*

(https|http):\/\/([\w]+[.])*(\b(?!(mail|hangouts|voice)\b)\w+\.)google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/([\w]+[.])*(\b(?!(mail|hangouts|voice)\b)\w+\.)google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http)://www.google\.(com|([a-z]{2}))(\.[a-z]{2})?/(advanced_search|advanced_image_search|advanced_video_search).*
(https|http)://www.google\.(com|([a-z]{2}))(\.[a-z]{2})?/(preferences)?.*

(https|http):\/\/(www\.)?mail\.google\.(com|([a-z]{2}))(.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(alerts)(.*)

(https|http):\/\/(www\.)?google\.(com|([a-z]{2}))(.[a-z]{2})?/(drive).*
(https|http):\/\/(www\.)?drive\.google\.(com|([a-z]{2}))(.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?(myaccount|accounts)\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?books\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(books)?.*

(https|http):\/\/(www\.)?books\.googleusercontent\.(com|([a-z]{2}))(\.[a-z]{2})?\/(books)?.*

(https|http):\/\/(www\.)?calendar\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(calendar).*

(https|http):\/\/(www\.)?contacts\.google\.(com|([a-z]{2}))(\.[a-z]{2})?.*

(https|http):\/\/((www\.)?((console.)?developers))\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?docs\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?\/intl\/([a-z]{2})\/(docs|sheets|slides|forms)\/about.*

(https|http):\/\/(www\.)?(docs\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(forms).*

(https|http):\/\/(www\.)?one\.google\.(com|([a-z]{2}))(.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(flights)(.*)

(https|http):\/\/(www\.)?groups\.google\.(com|([a-z]{2}))(\.[a-z]{2})?.*

(https|http):\/\/(www\.)?(maps\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(maps|local\/place).*

(https|http):\/\/(www\.)?google\.(com|([a-z]{2}))\/.*

(https|http):\/\/((www\.)?myactivity)\.google.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/((www\.)?news)\.google.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?patents\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?photos\.google.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?/photos/about/

(https|http):\/\/(www\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?\/intl\/(com|([a-z]{2}))\/photos\/about\/*

(https|http):\/\/(www\.)?play\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?scholar\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?script\.google\.(com|([a-z]{2}))(.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?support\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/(www\.)?translate\.google\.(com|([a-z]{2}))(\.[a-z]{2})?\/.*

(https|http):\/\/([\w]+[.])*(\b(?!(mail|calendar|voice)\b)\w+\.)google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(?!maps).*

(https|http):\/\/(www\.)?(images\.)?google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(((shopping|preferences|\?pli|search|webhp|imghp|\?tbm=pts|\?authuser)|(\?gws_rd=ssl)).*)?

(https|http):(www\.)?\/\/([\w]+[.])*(\b(?!(mail|hangouts|voice|maps)\b)\w+\.)google\.(com|([a-z]{2}))(\.[a-z]{2})?\/(?!(tools\/feedback)).*

(https|http)://www.google\.(com|([a-z]{2}))(\.[a-z]{2})?.*

// they all are google domains so...
// sadly there is no TLD wild card so if you want it to apply to otter country domains like google.co.uk, you have to add it

@match              *://*.google.com/*

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IMDB

(?=.*?api_key=127059960673829).*

@match              *://*/*?api_key=127059960673829*

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Stylus Dark Theme

chrome-extension://.*
moz-extension://.*

// not possible in Firefox 57+

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

YOUTUBE

https://apis.google.com/.*/widget/render/comments?.*&first_party_property=YOUTUBE.*
https://plus.google.com/.*/widget/render/comments?.*
https://plus.google.com/.*/notifications/frame?.*

@match              https://apis.google.com/*/widget/render/comments?*&first_party_property=YOUTUBE*
@match              https://plus.google.com/*/widget/render/comments?*
@match              https://plus.google.com/*/notifications/frame?*

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ZOOM

http[s]?://(?!(browserbench.org|mozilla.github.io|imdb.com|facebook.com|github.com)).*

@match              *://*/*
@exclude            *://imdb.com/* 
@exclude            *://facebook.com/* 
@exclude            *://github.com/* 
@exclude            *://miradetodo.co/* 
@exclude            *://www.google.com/* 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ANTI-WHITEFLASH

http[s]?://(?!(imdb.com|facebook.com|github.com|miradetodo.co|www.google.com)).*

@match              *://*/*
@exclude            *://imdb.com/* 
@exclude            *://facebook.com/* 
@exclude            *://github.com/* 
@exclude            *://miradetodo.co/* 
@exclude            *://www.google.com/* 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ZZGDP 05.07.19

http[s]?://(?!(imdb.com|facebook.com|github.com|www.google.com)).*

@match              *://*/*
@exclude            *://imdb.com/* 
@exclude            *://facebook.com/* 
@exclude            *://github.com/* 
@exclude            *://miradetodo.co/* 
@exclude            *://www.google.com/* 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ZZZ GoogleExtended

(https|http):\/\/(www\.)?.google\.(com|([a-z]{2}))(.[a-z]{2})?\/.*

// not exact but close
@match              *://*/*
@include_globs      *://*.google.com/??.??/*

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ZZZFacebook Squared

http(s)?://(?!business|developers|docs.google).*\.facebook\.com/(?!(v[0-9].[0-9]([0-9])?/)?plugins/|Fplugins|plugins/like|events_manager|ads|about/ads|analytics|business).*

// not exact but close

@match              *://*/*?plugins/*
@match              *://*/*?Fplugins*
@exclude            *://business.facebook.com/* 
@exclude            *://developers.facebook.com/* 
@exclude            *://docs.google.facebook.com/* 
@exclude            *://facebook.com/* 
@exclude            *://facebook.com/* 
@exclude            *://facebook.com/* 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ZZZGoogle Extended

^https?://www.google.(?:[A-z.]+)(?::)?/(?:(search|webhp))?.+
^https?://encrypted.google.com(?::)?/(?:(search|webhp))?.+
^https?://[^.]+.google.[^/]+/search[^t]*[^b]*[^m]*
^http?://[^.]+.google.[^/]+/search[^t]*[^b]*[^m]*
https?:\/\/www\.google\.[a-z.]{2,6}\/search((?!tbm=isch).)*$

// not exact but close

@match              *://*.google.com/search*
@exclude            *://*.google.com/searchtbm=isch

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ZZZGoogle Translator

https?://translate.google.(com|([a-z]{2}))(.[a-z]{2})?.*

// no TLD wild card so 

@match              *://*.google.com/*

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

05_GDT.css

http[s]?://(?!(accounts.google.com|adobe.com|color-hex.com|comodo.com|.*.dnsperf.com|.*.drive.google.com|.*.help.comodo.com|.*.id.avast.com|.*.imgur.com|.*.virustotal.com|.*.jpg|.*.png|.*.gif|.*.gifv)).*")

@match              *://*/*
@exclude            *://accounts.google.com/*
@exclude            *://adobe.com/*
@exclude            *://color-hex.com/*
@exclude            *://comodo.com/*
@exclude            *://*.dnsperf.com/*
@exclude            *://*.drive.google.com/*
@exclude            *://*.help.comodo.com/*
@exclude            *://*.id.avast.com/*
@exclude            *://*.imgur.com/*
@exclude            *://*.virustotal.com/*
@exclude            *://*/*.jpg
@exclude            *://*/*.png
@exclude            *://*/*.gif
@exclude            *://*/*.gifv

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

DARK BLANK TAB

@-moz-document url-prefix("about:blank"), url-prefix("about:newtab"), url-prefix("about:home"), url-prefix("about:privatebrowsing"), url-prefix("javascript:")

@-moz-document url-prefix("about:blank"), url-prefix("about:newtab"), url-prefix("about:home"), url-prefix("about:privatebrowsing"), url-prefix("javascript:")

@-moz-document url-prefix(about:blank)

// only about:blank is allowed by Firefox 57+
@matchAboutBlank    true

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

GITHUBUSER

@-moz-document url("raw.githubusercontent.com"), url("https://raw.githubusercontent.com"), url-prefix("raw.githubusercontent.com"), url-prefix("https://raw.githubusercontent.com"), url-prefix("https://raw."), url-prefix("raw."), domain("raw.githubusercontent.com"), domain("https://raw.githubusercontent.com"), domain("https://githubusercontent.com")

@match              *://*.githubusercontent.com/*
EstherMoellman commented 5 years ago

Wowwwwwwwwwwww... T-H-A-N-K-S! Yeah, I feel terrible because I know that asking you to convert my REGEXPs was the worst solution (not to mention that from my side it is also a kind of abuse of your patience and time). I'm aware that is wrong from my side. But I can't stop to thank you, because for me is a step forward toward the solution. So again, from the bottom of my heart: THANK YOU!

Before I start working in what you sent me, just to be sure, please are you planing to send me something else? I don't mind to wait. I prefer to receive everything you can send me, before I start to work. Again, even if you need more time, I prefer to wait you.

I promise I will read the MDN/FireMonkey' help, but I can't do it now, nor the next weeks. And I need to solve my REGEXPs' list, because I want to move 100% into FireMonkey, all my CSS/JS. More important, I want to do the same with all the member of my "FF' club". And this task/job will be 100% on me, because almost no one of my colleagues knows about CSS/JS, REGEXPs, normal patterns etc.

After confirming the reception of everything from you, I will work several days, in order to prepare and get ready all the stuff, to migrate all our 150 members to FireMonkey. But I only can do that, if before I test, and everything works reasonable fine. It'll be a nightmare if I migrate everybody to FireMonkey, but CSS/JS' scripts are incomplete, or not working etc.

erosman commented 5 years ago

Note: FireMonkey can run alongside GM & Stylus etc.. there is no conflict (but better not to run the same script in both of them at the same time).

You can start by moving scripts/css one by one (or move all and enable them one by one).

That way you can move and test them gradually.

I converted the RegEx in previous post.. you can try them now.

EstherMoellman commented 5 years ago

Thanks again @erosman ! I just asked because of the word "few", you wrote: "I will post a few that I have converted", and I thought perhaps you might have more to send me later. Anyway, if it is the case, if by chance you want to send me something more, please, it will be fantastic, more than welcome, most appreciated, a great help allowing me to start moving into FireMonkey. I'm very motivated, so I will do my best to start ASAP the migration.

erosman commented 5 years ago

At the time I posted initially, there were a few but then I completed them. Didn't you check it?

erosman commented 5 years ago

Off-Topic

Example of JS' script: https://greasyfork.org/en/scripts/40897-old-reddit-please

That one works on FireMonkey as it is, however .......... That script is very old style and not only inefficient but also puts a lot of load on the browser/computer.

It re-runs every 50 milliseconds, that is 20 times per seconds it gets every link on the page and processes it.

That way of doing it is NOT needed and not the best way of achieving the desired result.

EstherMoellman commented 5 years ago

At the time I posted initially, there were a few but then I completed them. Didn't you check it?

Even if the list you sent me would have matched the number of codes with the list originally I sent you, when you wrote "few", I stopped there, on the believe that "something else" may still needed to be done and sent. Also, no sense to check for me, because I don't have knowledge to differentiate if a REGEXP should be converted in one or more Match Pattern lines. Still looks hieroglyphics for me, because I never worked with Match Pattern, and my REGEXPs know-how is almost zero. But again, thank you from the bottom of my heart for sending me everything done. Of course I will check one by one as soon as I start the migration process. Also, I will learn empirically from your conversion, looking at each one of the Match Patterns you wrote. It is not going to be just a "copy/paste" from my side.

That script is very old style and not only inefficient but also puts a lot of load on the browser/computer.

Excellent! Fantastic! Thank you for your alert. Any suggestion for replacement? A simple redirector "www.reddit.com to old.reddit.com" will be enough, but it must work instantaneously, without delays.

What about this one? Do you approve? Efficient?: https://greasyfork.org/en/scripts/33274-youtube-no-autoplay-disable-up-next

And I will love if by chance you can share with me your " @erosman recommended JS' script list". The same goes for your CSS' scripts. And the same goes for your add-ons, specially those gems you keep in secret, built by and for your own private use : )

erosman commented 5 years ago

Any suggestion for replacement? A simple redirector "www.reddit.com to old.reddit.com" will be enough, but it must work instantaneously, without delays.

No.. but that is easy to write

What about this one? Do you approve? Efficient?: https://greasyfork.org/en/scripts/33274-youtube-no-autoplay-disable-up-next

Still old style but no major problems

And I will love if by chance you can share with me your " @erosman recommended JS' script list". The same goes for your CSS' scripts.

lol.. no ... as a programmer myself, all of my JS/CSS are written by me ;)

And the same goes for your add-ons, specially those gems you keep in secret, built by and for your own private use : )

No gems.... but specific use .... TBH, when I make them for myself, I dont bother about the user-interface. In fact, when making an extension, making the UI (user-interface) is one of the most time-consuming parts of it.

erosman commented 5 years ago

Any suggestion for replacement? A simple redirector "www.reddit.com to old.reddit.com" will be enough, but it must work instantaneously, without delays.

This script seems OK and light https://cable.ayra.ch/tampermonkey/view.php?script=reddit_old_design.user.js

Taken from: [Request] Make reddit.com links to take you to their old.reddit.com equivalent

EstherMoellman commented 5 years ago

Hi @erosman !

Firstly, thanks for the JS' script. I'll test later. PS: Feel free to recommend whatever you want. I love your recommendations, are very useful.

Second, I started preliminary tests before my "Big Migration". I already spent a bunch of hours. Sadly, I found lot of small difficulties. Some of them are related to conflicts with other add-ons. Other difficulties are conflicts between my codes, when CSS and JS run all together inside FireMonkey (after importing everything into FireMonkey, I have more than 100 separated code parts). It's not clear to me the causes of these difficulties, so first I'm going to do more tests, and only then I will share with you my results/questions. As a temporary workaround, I decided to do all my preliminary tests on a Firefox Nightly clean install (in order to be sure that there are no conflicts with other add-ons or personal customizations). Also, I am testing my codes only one by one (not all together, as you recommended yesterday). I don't need to solve these difficulties now. I'll see this later.

My first priority really is to test my codes at FireMonkey. But even at a Nightly' clean install, and testing my codes only one by one, I can't make work @match *://*/* If I use a specific url, it works. But when I try for all urls, I fail. I apologies to you in advance if I am doing something wrong. I just strictly copied/pasted the same bit of code you wrote me yesterday. Just to be clear, I am not testing yet the list of conversions you sent me yesterday. At this moment, I'm just testing @match *://*/*

If by chance I'm not doing anything wrong, perhaps this might be another "typo issue" like happened with "@run-at"?

erosman commented 5 years ago

I am also having problem with *://*/* There shouldn't be a problem. I will test again to see if there is an issue with Firefox. What is the version of Firefox you are using?

EstherMoellman commented 5 years ago

Nightly latest version. Windows 10 latest version.

erosman commented 5 years ago

I am on Nightly too 71.0a1 (2019-09-13) (64-bit) .. so it is possible that it is a nightly bug... still testing

erosman commented 5 years ago

Actually it is not a nightly bug... so there is bug somewhere.... I am still testing

erosman commented 5 years ago

Found the problem ... Silly overlook by me ... /* at the start and / in ://*/ * creates an error

I will see how it can be overcome

/*
==UserCSS==
@name           2test
@match          *://*/*
@author         erosman
@version        1.0
@run-at         document-start
==/UserCSS==
*/
erosman commented 5 years ago

@EstherMoellman That was an very good bug report :100: :1st_place_medal:

It is fixed ... I will do some more testing and release the update

erosman commented 5 years ago

v1.13 uploaded.. try now :)

EstherMoellman commented 5 years ago

@erosman , so today I spent lot of hours on FireMonkey. I haven't migrated yet. It was a day full of tests + lot of readings (FireMonkey' help, your previous messages full of teachings, MDN etc).

I found lot of small issues. But I found nothing catastrophic.

Most of the small issues are solvable with time, patience and lot of work. I believe this will take me 10 days of work (a little bit each day). I plan to start tomorrow very early in the morning. But anyway, this big migration is only a one time job, so it's not the end of the world at all. Also is an opportunity to improve old stuff, and to clean lot of accumulated garbage.

For users using Stylus, I do recommend your recommendations (LOL): It's worth doing some editions in Stylus, before exporting to FireMonkey (for example replacing REGEXPs directly in Stylus, not leaving the "everything" option or "empty" @matches etc). Everything edited at Stylus before exporting, will be less work at FireMonkey after importing.

The update function worries me a bit. At Stylus I have only one CSS' script per customized webpage, and it's updated automatically. When this CSS' script is imported into FireMonkey, it's separated in several scripts, each one for a specific variant of the same page. Sadly, this breaks the original updating function of the original CSS' script. So, the update needs to be done manually... and this is time consuming. If the domain is the same, no problem, is easy to unified the script, and to use a match pattern. But if the CSS' script is meant to different domains of the same page (with different scripts), then the update need to be done manually. I still need to evaluate how this may or may not hurt other users. This might be solved in the future, if you find a way to allow FireMonkey to deal with 1 script, having different domains, with different sub-scripts. If doable, then I leave you here my suggestion.

The @match *://*/* seems to work fine. Congrats and thank you! PS: You did a pretty fast correction, and this helped me a lot, allowing to continue my work in the same day. Good for my concentration. Thanks!

Some of the REGEXPs' conversions are not working. But I still focused on the big picture, solving issues from General => To particular. The next days I will see what exactly is not working, and I'll try to fix by myself. If I fail, I will ask your help : ) Specifically talking about REGEXPs, my conclusion is that is a trade: In one hand, REGEXPs facilitates lot of stuff. In the other hand, REGEXPs may hurt performance. I understand that most of users may love REGEXPs. Personally it is not my case. My priority always is performance, security and privacy. What I'm trying to say is that I'm fine if I lose some scripts due to REGEXPs' replacements.

I just hope all this work will really translate into performance improvement. RAM is not a preoccupation for me. It's cheap, and nowadays most of the users have plenty of RAM. But CPU, here I hope to see some gains due to FireMonkey' migration. I tried some online performance tests, but haven't seen big improvements. I'm sure, as you explained me, that FireMonkey must be more efficient than similar add-ons in terms of performance. But by chance, have you ever tested this performance improvement?

Have a nice Sunday wherever you are! : )

erosman commented 5 years ago

Stylus can have multiple rules for multiple unrelated pages in ONE page.

The fact is that although they appear to be one page, when Stylus applies above rules, it breaks it into multiple pages since one part has to be inserted into page A and another into page B and you can not insert them all into both page A & B

That is the practicality of it. It is just visually in one page, under one heading.

AFA userscript update, that is not possible. FireMonkey uses a totally different set-up and it can only be updated from a location that has written in the FireMonkey format (which is similar to the GM format).

That is the heart of having a unified format to be able to support both JS & CSS.

Once FireMonkey becomes more popular and people starts to write CSS in that format and there is a depository for it, then the auto-update becomes possible.

Centralised auto-update is possible if there is access to a server. Someone can updates the CSS/JS, put them on the server and then give the update URL to their users. Then users can auto-update from that URL.

EstherMoellman commented 5 years ago

... not really important and just for curiosity, again, have you ever technically tested FireMonkey' performance? (RAM, CPU etc).

Do you see/feel any difference using FireMonkey when compared to Stylus or similar CSS' add-ons?

What about JS Monkey' add-ons? Do you see/feel any performance difference? Are the JS' Monkey add-ons using the new API as FireMonkey uses?

erosman commented 5 years ago

have you ever technically tested FireMonkey' performance? (RAM, CPU etc).

Of course .... I wrote FireMonkey because I was concerned with the performance & security. Additionally, I am an addon reviewer for Mozilla (been since 2014, with the highest number of reviews).

To start with, using the Firefox dedicated API means better performance and security. Other script managers dont use the API yet. The dedicated API cuts user-script access to inner Firefox processes which greatly improves the security of the user-scripts for the users.

Other circumvented methods (not dedicated API) don't have that safeguard. In fact, I was the one who asked for this API over 3 years ago as I wanted to prevent user-script accessing higher Firefox functions. I also correlated with the Firefox team who were making the API and created FireMonkey as soon as API was created in FF 65 (even before it became standard in FF68). ;)