
There is a
change in the hub classifier. All the numerous articles about Chrome extensions
can now
be marked with this hub , which I urge the authors to make earlier written articles. In addition, on the occasion of the holiday, I would like to write a review about the history of Chrome extensions and user scripts, how they were formed and what kind they came to.
Persistent, but dubious growth: advertising cutters
At the beginning, many years ago, in the years 2000-2005, there were no browser extensions in the form in which we see them now. Scripts in the browser are meant to be written by the authors of the site and the page viewed in the browser. It would seem that there is nothing strange in this - the authors of the site have the full and undivided right to use browser resources ... stop. She found a scythe on a stone. Why should the authors of the page use the resources of my browser? Write your own arbitrary scripts that do not allow to show the content of your own page? Distract bad styles from the content of your page? And advertising on it?
And earned the user's inquisitive thought. My browser - by definition, it should bring convenience to me, and not promote the interests of the owner of the site, which I am currently considering. No, there are, of course, masochists who will defend the right of the author of the site, not being authors, but not everyone will agree with them. An example is redundant or not so much advertising, not related to the content for which the reader came. Or imperfections or errors in the design of the pages. Or the reader’s desire to see additional information on the same page. All this leads to the desire to have a mechanism next to the browser that processes some parts of the pages.
')

For example, the earliest examples of page processing were implemented as a local proxy server, through which pages were passed to filter its content, mainly to remove ads. History remembers the attempts of the owners of the sites against the creators of these programs. For example, there was a legendary representative of this class of programs,
Proxomitron , whose author in June 2003 refused to support and develop his program due to pressure on him, which threatened to result in prosecutions. There were several such examples, but after a couple of years there were so many proxy programs that it was pointless to fight them, but there were practically no real examples of the struggle - only some programs existed that stopped developing.
At the same time, the language in which the ad insertion parser was written was not necessarily was Javascript. The language of adblockers was and is declarative and specialized, it remained so in the most famous AdBlock Plus - a blocker that was formed already in the era of Javascript browser extensions. At the same time, parsing the input pages in the proxy server program blocker could also in Python, for example. The main purpose of the blockers is to cut parts of the page, looking for unnecessary parts as efficiently as possible without disrupting the page layout (layout).
Learn more about the modern relationship between blockers and advertisers
(eng.) -
www.computerworld.com/s/article/9245190/Ad_blockers_A_solution_or_a_problem_ .

Custom styles
Another class of ideas on effects on pages is page modification. since the CSS rules affect the display to a large extent, a subsequent idea emerged - to add our own rules to the set of CSS rules. By the way, they can partially perform the tasks of hiding unnecessary blocks, although not as effectively as HTML crawlers. But they have a plus in that the style rules continue to influence the page with the dynamic modification of the DOM (page element structure), which is more and more typical in recent years, starting around 2008-2009 milestones. In addition, style modifiers perform not only a destructive, but also a decorating role, they can ennoble or simply change the original style of the pages. The ability to set custom styles is even entered in the IE6 browser (“Accessibility - Format documents using my style sheet” in the settings) and in Windows Mobile 2003 (through the registry).
Mixing styles is easy to do through the inclusion of CSS rules in the HTML method of working with a proxy server.
Custom scripts

The proxy server can prevent the introduction of Javascript scripts into the site page, but you cannot modify subsequent changes to the DOM (except for the introduction of handwritten scripts instead of or in addition to the site scripts). To facilitate access to scripts in page space over the course of browser evolution, custom scripts have been invented. The first version of the Greasemonkey add-on of the Firefox browser appeared
in March 2005 and allowed writing short and simple user scripts. More precisely, it was possible to modify the behavior of the browser (Internet Explorer plug-ins, add-ons and Firefox plug-ins), but the whole question was in the complexity of the intervention, in the support of the intervention method with the advent of new browser versions and in the compatibility of the custom plug-in with others. The circle of technologies and the threshold of entry were methodologically reduced, so that a small impact on the site using its own script was simple and that it did not conflict with the browser development process.
Again, there is no reason to refuse proxy servers for the implementation of scripts. After all, userscripts actually started at the moment when the webpage was finished loading, and this was worse than tag injection with scripts enabled, because all other tags with site scripts had time to start and execute. If desired, the site script could more effectively oppose users scripts than they did to page scripts. But no script was completely suppressed, because each has its own local environment of script variables for its execution. (To compete for shared resources like Global Scope and DOM, rewrite them - yes, any of these scripts can.)
Another argument in favor of the inclusion of a proxy server against userscripts is universality for various browsers. Any browser can easily be taught to work with a proxy server, but not all browsers initially had a mechanism for introducing userscripts in their arsenal. Interestingly, quite soon all new browsers considered it their duty to have similar implementation mechanisms and supported Greasemonkey’s de facto functions that have become the standard, except for IE browsers, but they also had ways to implement user scripts using third-party programs. True, IE for a long time, up to the IE9 version had a very different way of working with DOM at the Javascript level, which determined its isolation from the main flow of browser development. In the IE11 version, browser developers have tried to minimize these differences. But the problem remains in the coverage of users by platform (operating system). IE11 can be installed or shipped initially only with windows 8 systems (from June 2013) and Windows 7 (from November 2013). Users of other operating systems can not even install this browser, except for the use of virtual machines. Therefore, the number of potential users of the browser and userscripts in it is strongly limited by the distribution policy.
A similar situation with the limited distribution has developed with the Safari browser since May 2012, when the last Safari 5.1 update for Windows was released and then it did not develop on this system and the others, except Mac OS. But up to this point, developers could count on a rather large coverage of users userscripts on Windows and Mac OS platforms.
In Opera 8.0 in April 2005,
support for userscripts also appeared
, along with Firefox. In contrast, the Opera add-on mechanism did not exist for a long time, and it was necessary to install scripts manually (create a file with a script) and through browser settings.
To all, I must say that users of userscripts, usersstyles and proxy servers were relatively few in relation to the total number of site visitors. For the most part, these technologies are made geeks for geeks, and the relative ease of installing scripts through Greasemonkey is in itself a great and atypical achievement.
The problem is not only that scripts bring additional danger of access to user data. The first problem is that convincing the user to make an extra move and installing the add-on program is a difficult task that can be done for about 1-5% of the total number of users of a site. Basically, because site owners tried to make them convenient for users, so it was not often the strong need to change functions and design.
Even add-ons, which are discussed below, which were able to reduce the installation distance to 2 clicks, could not and could not solve the problem of user confidence in extraneous add-ons. All add-ons will remain marginal as long as there is a credible site owner. And if there is no trust, then another website will appear on the Internet with a different owner who is more trustworthy than someone who will “save” the first site en masse, wholly dependent on the donor site.

Browser Addons
Users scripts that are launched after launching scripts do not always suit (few of them) users. The script of the page managed to do something unnecessary, spoil the look, flash a banner and, in general, spend the processor time on its execution. Therefore, Firefox, starting with version 0.X, had an initial approach to the idea of ​​building a system of plug-ins that are simpler to write than IE plug-ins and than the plug-ins of Firefox itself that have not disappeared. If the task allows you to restrict yourself to a smaller number of technologies than knowledge of the entire browser structure, then it was solved as part of building an add-on (add-on) based on
XUL (XML User Interface Language) technology, made specifically for working with Firefox, the Gecko engine and products.
Over time, this approach was revised, and for Chrome add-ons, which were called “extensions,” they no longer invented a new language and technology (similarly, Safari extensions). Everything is built on HTML and Javascript API. Over time, it took to create a lot of similar add-ons, the API is multiplying, partially duplicating, in Chrome Apps, Chrome OS, but the approach does not seem slow and does not create a specific threshold of entry. There is a threshold, but it is determined by the structure of applications as frameworks (for example, you need to know the purpose of the elements of the manifest.json file) and the number of API functions.
Eventually
As a result, the zoo browsers got not very diverse, which is already good, the zoo of add-ons, extensions and scripts.
* Greasemonkey and Scriptish in Firefox -
addons.mozilla.org/en-US/firefox* user scripts in Firefox, Chrome, Opera and Safari (with NinjaKit) -
userscripts.org* extensions of the old Opera; new Opera -
addons.opera.com/en/extensions* Chrome extensions -
chrome.google.com/webstore/category/extensions* Chrome apps -
chrome.google.com/webstore/category/apps* Safari
extensions -
extensions.apple.comYou can remember, already in the past tense, about the extensions of the old Opera, which were relatively few, but they were quite simple on the level of complexity of the Safari and Chrome extensions. New extensions for the new Opera,

built on the same engine as Chrome, have a minimum of differences in functions from Chrome extensions. Most likely, there are restrictions due to the non-implementation of specific features of the Chrome browser, but not differences in the engines and API.
In percentage terms, the branch of Chrome extensions is developing most actively. It is the most popular and fast browser, which works everywhere, and has a well-developed and flexible API, and ease of access to it.
As examples, one can cite many extensions, some of which are made specifically for the Habrahabr site and targeted in the last 2 years primarily on Chrome.
Theory:
- We translate Chrome extension to manifest_version 2 , utf , August 21, 2012
- Userscripts. We pack user scripts for Chrome , @ MrMig, October 14, 2011
- Accessing JavaScript web pages from extensions for Chrome , Houston , July 16, 2013
- Writing an extension for Google Chrome (and publishing it) , paththeir , February 26, 2013
On the topic of Habr:
- Chrome HabraMail Extension (and favicon method) , donnerjack13589 , February 24, 2010
- Google Chrome Extension Habrahabr.ru-Tools-PATCHED , Goder , October 13, 2011 (and two more, but the author is read-only)
- Google Chrome Extension: Printing articles from habrahabr , Bookin, March 5, 2012
- Karma extension for Google Chrome , 404tesla , September 23, 2012
Others:
- Chrome extension over the weekend , brukva , January 10, 2014
- We work with the VKontakte API from the Google Chrome extension , crea7or , February 27, 2013
- Google Chrome Extensions: Making Hot Keys , UZER2006 , March 5, 2013
- The story of one Google Chrome extension , mamchyts , October 26, 2013
UPD 10/18/2014: The hub was renamed “Browser Extensions”, as suggested
almost from the very beginning . A few months is a good reaction time, it is constantly decreasing.