Why You Should Use Userscripts And Not Extensions When Possible

Martin Brinkmann
Apr 4, 2010
Updated • Mar 27, 2019
Internet, userscripts
|
21

If you want to add functionality to your web browser, you have the option to install extensions - or add-ons and plugins as some browsers call them - or userscripts usually.

Extensions are small programs that are loaded at the start of the web browser while userscripts only become active on the pages they have been designed for.

That is the biggest and most important difference between those two but there are other. Extensions are offered from official repositories such as the Chrome Web Store or Mozilla AMO, and scripts on third-party sites.

Extensions vs. user scripts

Lets look at an example on the main difference between extensions and scripts. Lets say you are a big Facebook user and want to improve your experience on the social networking site by adding features and shortcuts to it.

Facebook Fixer is a userscript that might offer exactly what you are looking for. It can do all sorts of things like displaying bigger album pictures and photos, showing age information and signs, enabling keyboard shortcuts or automatic reloads on page errors.

A similar functionality is also provided by extensions like the Better Facebook Fixer extension for Google Chrome. It basically offers the same functionality as the userscript but with a small but noticeable difference.

I'm using Google Chrome for the example because it offers a task manager that lists the memory usage of all open tabs and extensions.

If you install the extension you notice that it uses about eight Megabytes of computer memory constantly. It runs in the background all the time even if you are not on Facebook or don't have a single website open in Chrome.

The userscript on the other hand will only run when you visit Facebook.

It can generally be said that userscripts are more resource friendly than extensions. The situation is a little bit different for Firefox users who have to install an extension to use userscripts, and for scripts that require an extension like Tampermonkey in other browsers such as Chrome.

But it is beneficial for them as well if we assume that the extensions will likely use a similar amount of computer memory meaning it is a tie if only one userscript is installed and an improvement if you install more than one.

This theory obviously only works if the extension and userscript offer similar functionality.

There are a couple of other differences. Extensions may offer preferences or options that you can control from a manager that the browser ships with, while userscripts may require manual edits or provide you with options to change options when you visit one of the supported sites.

Last but not least, it is necessary to talk about security. User scripts are not inherently less secure than extensions but they don't get reviewed like extensions would. While extension stores accepted listings for malicious or problematic extensions in the past, it is more Wild West when it comes to scripts.

Closing Words

User scripts are very useful when it comes to changing content on websites that you visit frequently or regularly, and there is nothing wrong in using them if you take the time to go through the code to make sure that they are clean and not malicious or otherwise problematic.

What do you prefer to use: Extensions or userscripts?

Summary
Why You Should Use Userscripts And Not Extensions When Possible
Article Name
Why You Should Use Userscripts And Not Extensions When Possible
Description
Find out why it is usually better to run userscripts instead of extensions in your web browser of choice.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. hepha said on September 13, 2013 at 10:47 am
    Reply

    nmaier/about-addons-memory · GitHub
    “about:addons-memory

    Provides an about:addons-memory page, listing the memory usage of all active add-ons”
    https://github.com/nmaier/about-addons-memory#aboutaddons-memory

  2. woody said on January 5, 2013 at 6:50 am
    Reply

    hello, Martin Brinkmann, i like your blog, and learn so much and translate some for chinese FF fans.

    for firefox, i personally think the addon is as equal as, if not more efficent than the script, but i`m not sure, cause the addon is a pack of JS compressed into zip formation. if we use extensions.alwaysUnpack to unpack the addons into JSs, what`s the difference between addon and the scripts?

    personally, i unpacked addons into folders, cause i use image file and RAM to load FF`s application and profiles on startup.

    i wonder what`s the biggest difference between addons and scripts of UC and greasemonkey? how nagtive effects does addon lead?

  3. Angel R. Rojas, Jr. said on April 5, 2010 at 2:57 pm
    Reply

    Just a thought… and really, this is just a thought for discussion, but it seems to me like most computers these days have PLENTY of RAM to spare. My “daily driver” has 8 GB and I’m lucky to be burning 3 GB under full load. My laptop has 4 GB and I’m rarely hitting 2 GB of usage. I guess what I’m saying is that I don’t watch my memory as carefully as I used to back when 512 MB or less was the norm. Would this tip be more helpful for those using netbooks with 1 or 2 GB of RAM or is it even really negligible then?

    1. shle896 said on April 5, 2010 at 10:43 pm
      Reply

      You make a good point. I think most newer computers can handle just about anything if you have a fast cable connection.

      I do think you can have too many extensions in a browser, which can slow it down and make it buggy, . That’s been my experience in the past with Firefox, but since I switched to Chrome, I haven’t noticed any slowdown with the 18 extensions I have enabled.

      Chrome RULES! It’s so insanely fast and makes all the others seem lethargic in comparison.

  4. Dougle said on April 5, 2010 at 12:01 am
    Reply

    Whilst there may be some small overlap between userscripts and addons, I believe they are aimed at two different markets. Addons can provide a great deal of functionality that scripts simply cannot, particularly in areas such as security and privacy, consider addons such as lastpass or betterprivacy, or perhaps noscript, tab mix plus, or cookie monster etc.

    Another consideration for firefox at least, is security. Addons.mozilla are constantly monitored for malware, witness the recent problem with a certain addon, there are no such checks for this at userscripts. Basically, unless one is prepared to manually verify the code, one takes what one gets.

  5. Shrijit said on April 4, 2010 at 5:24 pm
    Reply

    Totally in agreement with Martin. I used to have 100+ addons, now I am using more of scripts and I can see considerable difference in Memory utilization. Is there anyways, I can check the mem utilization extension-wise in Firefox? I know, its a single process, but still, is there any way?

    1. Dougle said on April 4, 2010 at 11:48 pm
      Reply
  6. Ben said on April 4, 2010 at 4:53 pm
    Reply

    This is only true for chrome when the extensions are using a Background page. Also, extensions in chrome have automatic updating while userscripts do not.

    1. Dougle said on April 4, 2010 at 11:45 pm
      Reply

      There are several scripts that can automate the process of checking for updates, Here’s a couple:

      http://userscripts.org/scripts/show/52251
      http://userscripts.org/scripts/show/38017

  7. Saurabh said on April 4, 2010 at 4:27 pm
    Reply

    Add the fact that userscripts let you stay independent of the browser as the same userscript can run in nearly all browsers.

  8. shle896 said on April 4, 2010 at 2:41 pm
    Reply

    I prefer userscripts myself, but generally when I go to userscripts.org, I find the whole experience as cluttered and disorganized. There are so many scripts that are supposed to do the same thing, but depending on who wrote them and how old they are, that’s not always the case.

    It also seems that they can stop working at any time and it’s difficult to keep track of them. Although userscripts are more manageable in Chrome, the whole userscript process to me is just “messy”.

    1. Shrijit said on April 4, 2010 at 5:30 pm
      Reply

      Agree with shle896. The scripts are not organized in userscripts.org and there are lots of obsolete scripts. There is one add-on called “Greasefire” which can find out the scripts for a particular webpage. Its a nice add-on and serves the purpose of searching add-ons without visiting userscripts.org.
      Adding to userscripts, there is something called “userstyles” which does the same. You need to install “stylish” add-on and the scripts can be found in userstyles.org.

      1. Dougle said on April 4, 2010 at 11:36 pm
        Reply

        In firefox the css from userstyles, in most cases, can be added to userchrome,css obviating the need for the extension.

  9. Dougle said on April 4, 2010 at 1:29 pm
    Reply

    firefox is my choice, I personally can’t stand Google Chrome, but that’s another story.

    I use a mixture of addons and userscripts. At the present time, that amounts to 29 addons and 10 scripts. Whilst I can’t tell you the resource consumption for the scripts, I can say that the 29 addons weigh in at less than 20mb combined. With the two largest being noscript and tab mix plus, at around 1700k. The smallest is bottom error console at 8k.

    1. Jojo said on April 4, 2010 at 10:15 pm
      Reply

      How do you know how much memory each extension is using?

  10. Anonymous said on April 4, 2010 at 12:17 pm
    Reply

    extensions have automatic update

    in any case I have 3gb of memory on my laptop

    1. Martin said on April 4, 2010 at 12:22 pm
      Reply

      You can have automatic updates for userscripts as well

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.