-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.org
More file actions
67 lines (39 loc) · 7.18 KB
/
Copy pathREADME.org
File metadata and controls
67 lines (39 loc) · 7.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
* UserScript? What's A UserScript?
If you don't know what userscripts are, you can read about [[http://bit.ly/ypj8z2][Greasemonkey]]. I happen to prefer the [[http://bit.ly/xYcpv7][Scriptish]] add-on over Greasemonkey but the GM wiki page seems to be the best description I have found about userscripts. (If you have a better reference, I'd love a pointer.)
** My UserScripts Online
Many of my userscripts can be found on my UserScripts.org [[http://userscripts.org/users/66250/scripts][profile page]].
* Google Opt-Out
[[http://bit.ly/r1GLJZ][Google]] is (in)famous for its [[http://bit.ly/NuG7KT][web tracking]] via its [[http://bit.ly/NuG69H][Google Adwords]] online advertising network, as well as tracking users on their site, and other means. Google provides a [[http://bit.ly/NuGbdG][semi-effective]] [[http://bit.ly/KJ7Inj][opt-out]] mechanism. Google's [[http://bit.ly/NuGBkh][opt-out page]] recommends installing a [[http://bit.ly/NuGBkh][browser extension]]. It provides versions of this add-on for most popular browser. The browser extension for [[http://bit.ly/HzqbTy][Firefox]] is 73K bytes.[5]
While 73K bytes is not a ridiculous amount of memory, apparently only a single line of [[JavaScript] is required:
: _ga_user_prefs = false;
Browser extensions are also known to cause [[http://bit.ly/NUqmxs][memory leaks]].[3][4] This UserScript implements the Google opt-out mechanism in under 700 bytes; most of which is required UserScript [[http://bit.ly/NUrXDd][metadata]]. That's less than 10% of the Firefox add-on.
Some browsers (eg: [[Chrome]) run UserScripts directly. Other browsers require extensions to utilize UserScripts. For example, Firefox requires [[http://bit.ly/NUvoKf][Scriptish]], [[http://bit.ly/Kk9A6R][GreaseMonkey]], or a similar extension. These extensions tend to be large. I would say that, for browsers that require an extension to run a UserScript, it only makes sense to use this UserScript if you already have an extension to run UserScripts installed in your browser.
As mentioned previously, Google's opt-out mechanism is only [[http://bit.ly/NuGbdG][semi-effective]] and can be beaten by individual web pages. This UserScript is no better than Google's semi-effective opt-out extension.
- [[http://bit.ly/NUyeyQ][Source Code]]
- [[http://bit.ly/NUzQIS][Installable Script]]
* Timely Google Search
By default, a Google search returns all results dating to the beginning of time (at least internet time). I find that for over 99% of my searches[1] I either only care about information from the past year or that there are enough new or updated postings in the past year that I don't need to search further back.
As a quick example, as of the time of writing this (13 April 2012), a Google search for /Google map help/ returns 836 million hits for the [[http://bit.ly/J9lf6J][past year]] compared to 1.2 billion hits for [[https://www.google.com/search?q=google%20search%20help&ie=utf-8&oe=utf-8][all time]].
While the nearly one third reduction in total search hits likely doesn't matter much to me as I probably will never look at most of them, limiting the search to the past year eliminates links to old articles such as [[http://bit.ly/HS4Z9Q][this one]]. That 2006 blog article is the 11^th hit on my /all time/ search, [[http://en.wiktionary.org/wiki/YMMV][YMMV]][2]. Personally, I am infuriated when I find that I have wasted my time reading some long-outdated article.
The [[https://raw.github.com/Neil-Smithline/UserScripts/master/timely-google-search-year.user.js][Timely Google Search Year]] userscript defaults all Google searches the past year. If you want to search all of eternity, you can simply hit the /Any time/ link on the left side of the Google results and you'll have your unrestricted search.
- [[https://github.com/Neil-Smithline/UserScripts/blob/master/timely-google-search-year.user.js][Source Code]]
- [[https://raw.github.com/Neil-Smithline/UserScripts/master/timely-google-search-year.user.js][Installable Script]]
* AMO: Up Top Version Info
[[http://bit.ly/HJCDRj][AMO]] is the site that provides discovery, download, and installation of add-ons for [[http://bit.ly/IGtTL8][Firefox]] and other [[http://bit.ly/HJCSM7][Mozilla]] [[http://bit.ly/HJD0Lt][applications]]. When searching on AMO, it cleverly restricts add-ons to those that match the version of Firefox that you are using.
But since Mozilla changed their [[http://bit.ly/IGtqso][release schedule]] to release a new version every 6-weeks, add-ons have had a hard time staying current. So every 6-weeks, every add-on becomes outdated and must go through Mozilla's AMO update process to be considered safe to work with the newest version of Firefox. Mozilla's cautious approach to declaring add-ons compatible with new releases helps to ensure that Firefox is a stable application.
But some users (eg: me!) are willing to run an add-on that was considered compatible with a previous version of Firefox but not the version the user is currently running. But this must be done with care. The risk of installing an incompatible add-on grows with each release.
For example, if you are running Firefox version 13, you may be comfortable installing any add-on that was compatible with Firefox version 12 and willing to risk installing your favorite add-ons that were compatible with Firefox version 11 or even 10.
Also, as a general rule, you never, and I mean /never ever/, want to install an add-on that isn't compatible with a Firefox version of 4 or more.
Unfortunately, the default AMO layout has the version information at the bottom of an add-on's page and hidden until you click on the /Version Information/ box.
The /AMO: Up Top Version Info/ userscript copies the most relevant parts of the version information and puts it right on the top of the page next to the /Install/ button.
The script tries to style the /up top/ version information to flow naturally with the existing page. It puts the version information in a box that can be themed for different colors (for now you must edit the script to change themes - sorry).
The box is also dynamically sized so that it can handle /Install/ buttons of different width. For example, at the time of writing this (13 April 2012), the [[http://bit.ly/HHEBCi][My Homepage]] add-on has a wider /Continue to Download/ button in place of an /Install/ button. The dynamic sizing also allows for buttons of different widths that will occur in non-English pages.
- [[https://github.com/Neil-Smithline/UserScripts/blob/master/amo-up-top-version-info.user.js][Source Code]]
- [[https://raw.github.com/Neil-Smithline/UserScripts/master/amo-up-top-version-info.user.js][Installable Script]]
# LocalWords: Userscripts
* Footnotes
[5] I only state the size of the Firefox extension because its size is easily accessible (it states its size on installation). I have not taken the effort to determine the size of the extensions for other browsers.
[3] Mozilla's [[http://mzl.la/NUpwkh][memory leak prevention page]].
[4] Generic JavaScript pgae on [[http://bit.ly/NUpUPz][preventing memory leaks]].
[1] Yes. I've checked Google's history of my searches to know that 99% is an accurate number.
[2] Google has optimized their search engine for speed over accuraty. This optimization can lead to getting slightly different results on the same search.