yasingedik / Aol Reader Optimized

Been seeing this particular here a lot lately...

Rather than having Greasemonkey (the user.js engine) create dozens if not hundreds of <style> tags with code such as yours, from this snippet:

GM_addStyle(".header-search-wrap { margin-top: 0px !important;}");
GM_addStyle(".dropdown-menu-add .page-container {height: 498px !important;}");
GM_addStyle(".dropdown-menu-add {height: 500px !important; left: -50px !important; max-height: 500px !important;}");

// The rest of your CSS rules in here too e.g. ...

it might run more efficiently in the DOM if you only use GM_addStyle minimally like this:

GM_addStyle(
  [
   ".header-search-wrap { margin-top: 0px !important;}",
   ".dropdown-menu-add .page-container {height: 498px !important;}",
   ".dropdown-menu-add {height: 500px !important; left: -50px !important; max-height: 500px !important;}"
   // The rest of your CSS rules in here too e.g. ...

  ].join("\n")
);

Just a suggestion. :)

One other quickie too...

// @downloadURL	https://openuserjs.org/install/yasingedik/Aol_Reader_Optimized.user.js
// @updateURL	  https://openuserjs.org/install/yasingedik/Aol_Reader_Optimized.meta.js

... This is not really necessary anymore especially on OUJS (here) but if you wish to keep it in there one of them needs to be modified so you don't kill updating.

// @downloadURL	https://openuserjs.org/install/yasingedik/Aol_Reader_Optimized.user.js
// @updateURL	  https://openuserjs.org/meta/yasingedik/Aol_Reader_Optimized.meta.js

The user.js engines out there handle updating automatically now by trying to see if the meta routine exists first... in our case here on OUJS we focus on using the header not the .meta.js extension.

Hope some of this helps you out. :)

Hey Marti,
Thank you very much for the suggestions. It is been so long since I've checked scripts.
I will update accordingly at first opportunity.
Regards

Hi Marti,

I applied your suggestion with GM_addStyle, but it does not seem to work in chrome with tampermonkey. It is higly possible with how I add styles. I would be glad if you can point me to a resource to learn how to fix that.

Thank you!

Re: @yasingedik:

I would be glad if you can point me to a resource to learn how to fix that.

It should be supported in JavaScript and the Array method of join is also base JavaScript so shouldn't need to be dependent upon Tampermonkey. shrugs

You might try the line continuation character of \ instead of these functions too if there is some issue in those browsers not supporting standard JavaScript methods:

GM_addStyle("\
  .header-search-wrap { margin-top: 0px !important;}\
  .dropdown-menu-add .page-container {height: 498px !important;}",\
  .dropdown-menu-add {height: 500px !important; left: -50px !important; max-height: 500px !important;}\
"})();

This is not as pretty and readable I think but will also simplify the DOM a bit since GM_addStyle can create style tags at every use... if you find a way to put it as one big string then utilize that GM API once you'll be speeding up the page a bit. :) Thanks for the consideration.

Unfortunately, that approach did not work either. Maybe the styles had to be in some order, I am not sure, not a web dev :/
Thank you for the help

Re: @yasingedik:

... did not work either...

Now you've really peaked my curiosity here...

  • First off do you have a public link to a page where this script is supposed to make a large visible alteration so I can see what kind of style you are applying? e.g. not just http://reader.aol.com/
  • Secondly... for grins I did a temporary fork of your project here to test in TamperMonkey versus your individual ones in this one.

Let me know at your earliest convenience for the above.

Re: @yasingedik:

... did not work either ...

Found a reason for SeaMonkey and Firefox that it won't work... because some of your CSS rules don't have a closing } on a few lines. e.g. the CSS is being dropped due to syntax errors in the styling. Try the fork I did in TamperMonkey and let me know how it goes for you. Thanks. :)

Re: @yasingedik:

You're welcome... should make it a little easier for you to make changes too. Removing my fork now. Merry coding! :)