Greasemonkey Safari



Greasemonkey is a userscript manager made available as a Mozilla Firefox extension. It enables users to install scripts that make on-the-fly changes to web page content after or before the page is loaded in the browser. The changes made to the web pages are executed every time the page is viewed, making them effectively permanent for the user running the script. Greasemonkey can be used for customizing. GreaseKit: Greasemonkey Scripts For Safari And More. Greasemonkey, the user scripting framework that can inject code into sites and add features, functions smoothly in Gecko-based browsers like. Creammonkey adds Greasemonkey-like user scripting to Apple's Safari and is implemented as an InputManager bundle.

  • Info

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/8068-1-greasemonkey-emulation/code/1%20Greasemonkey%20Emulation.js?version=36732

Ask a question, post a review, or report the script.
Ratings
000
Version
2.0.1c
Created
2015-02-14
Updated
2015-02-14
License
GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
Greasemonkey In the uncommon situations where someone wants to run a userscript via one of the lesser-known methods other than Greasemonkey/Tampermonkey, one runs into trouble with scripts that were written to expect the availability of the Greasemonkey API GM_ functions. A few adept scripters have written emulation libraries for some of those functions. This is a copy of one of those libraries, which previously hadn't been posted on Greasyfork, with a few small modifications I made (added logging-only stubs for GM_setClipboard, GM_getResourceText, & GM_getResourceURL; commented out the outdated userscripts.org-based update code); the unmodified version is also available in this posting's history. In addition to the predecessors of this script mentioned in the author Lil Devil's notes below, the other similar libraries I found are: joeytwiddle's FallbackGMAPI (us-m, github) and arantius's Grant None Shim (us-m, github).
This script library was archived from http://userscripts-mirror.org/scripts/show/105153
Author: Lil Devil
Script Name: Greasemonkey Emulation
Last update Jun 20, 2011 — Installed 12,199 times.
Script Summary: Emulate the Greasemonkey GM_* functions for other browsers. Greasemonkey safari lodge
A 'user script' is a script that runs in your web browser to change, enhance, and alter the appearance and function on a given website. Firefox, Chrome, and Opera all support user scripts natively. Safari and Internet Explorer will run user scripts if you also install optional extensions.
A 'Greasemonkey script' is a user script that was written for Greasemonkey (which runs in Firefox) and uses proprietary GM_ functions. Most user scripts (about 60%) do not use any GM_ functions, and will happily run in any browser that supports user scripts.
The remaining 40% of user scripts do use one or more GM_ functions, and if you want to run them in a browser other than Firefox, you need to use a Greasemonkey emulation script.
This emulation script is based on the Greasemonkey Emulation script by ale5000, which in turn was based on the Emulate GM functions script by TarquinWJ.
This emulation script will help make most Greasemonkey scripts work in the following browsers:
- Google Chrome 8 and newer, but you have to build an extension containing your Greasemonkey script and this emulation script.
- Safari 5 and newer, with NinjaKit. May also work with GreaseKit, but is untested.
- Opera 10 and newer
- Midori (untested, but the previous version worked, and my changes shouldn't have broken anything.)
In addition, this script will help make some Greasemonkey scripts work in the following browsers:
Greasemonkey- Internet Explorer 8 and newer, with IEPro
This script will enable all GM_ functions in Internet Explorer, but IE does not support many basic JavaScript and DOM functions that many Greasemonkey scripts use, so some scripts will get errors and stop running. Scripts can be written to be compatible with IE, but many scripts written specifically for Greasemonkey will not work in IE without additional work. Please contact the original script author and ask him/her to make their script compatible with IE.
GM_ Functions
This emulation script emulates all of the following Greasemonkey functions:
GM_setValue
GM_getValue
GM_deleteValue
GM_listValues
- These functions use the best available of scriptStorage, localStorage, or cookies to save data.
GM_addStyle
- Works just like the Greasemonkey function.
GM_xmlhttpRequest
- Works just like the Greasemonkey function. To enable cross-origin requests in Opera, see the note below in the Opera section.
GM_log
- Works just like the Greasemonkey function. Logs a message to the console. If unable to find the console, uses an alert().
GM_openInTab
- Opens a new tab where possible, otherwise it opens a new window.
GM_registerMenuCommand
- Implements the 'User Script Commands' menu as a pop-up menu in the lower-right corner of the browser window. The menu can be opened by pressing Ctrl- or by clicking your mouse in the lower-right corner. After it is opened the first time, a small 'S' icon will remain visible.
GM_renameMenuCommand - Usage: GM_renameMenuCommand( oldCaption, newCaption, newAccessKey);
- Replaces the text of a menu command.
Please refer to the Greasemonkey API reference for more information on each of these functions.
Browser Notes
Opera [outdated information; use Violentmonkey or Tampermonkey for Opera now]
Download the file, rename to aab-greasemonkey-emulation.js and put it in your Userscripts folder.
If you have another GM emulation script installed, such as aagmfunctions.js, you must remove it from the Userscripts folder.
To enable cross-domain GM_xmlhttpRequest, you must also install this script, however most Greasemonkey scripts do not need this.
In Opera 10.62 and newer, you should go to the opera:config page and set the 'User JS Storage Quota' to a non-zero value. I suggest 5120. This enables user scripts to store private, cross-domain settings like in Firefox. If this setting remains disabled, user scripts must use localStorage which is not cross-domain, and can be read by other scripts.
Internet Explorer [outdated information; use TrixIE WPF4.5 or GreasemonkIE now]
Download the file, rename to aab-greasemonkey-emulation.ieuser.js and use IE[7]Pro to install it.

Greasemonkey Safari Download

Safari with NinjaKit [outdated information; use Tampermonkey for Safari now]
Download the file, rename to aab-greasemonkey-emulation.user.js and put it in your Userscripts folder.
Midori
Download the file, rename to aab-greasemonkey-emulation.user.js and put it in your Userscripts folder.
Google Chrome [outdated information; use Tampermonkey for Chrome now]
This is a bit more complex than the other browsers. You need to build an extension. But it's really not that difficult. The first time I did it, I had to figure out what I was doing, and it took about 15 minutes. Now I can create an extension in less than 5 minutes. With these instructions it shouldn't take you much longer. To do.
Release Notes
2.0
  • Extensive changes to GM_registerMenuCommand
    • Support multiple copies of the emulation script, such as when embedded in extensions. This is done by storing all menu information in the DOM instead of in internal arrays.
    • Menu hotspot is always available, but only shows icon and menu after dragover.
    • Changed hotkey to ctrl-
    • Support keyboard navigation (up arrow, down arrow, enter)
  • Changed GM_addStyle to add style in plain text for easier debugging of userscripts.
  • Changed GM_xmlhttpRequest to only log an error if there is not a proper 'onerror' handler.

Version: 2.0 [updated by clickhappier to 2.0.1c on 02-14-2015]

Ever felt that you have had the need to enhance your web browser, or the functionality of some web site you frequently visit? Here I will explain how to do that.

How to extend web browser functionality

Firefox is of course the uncrowned king of offering extending functionality to its web browser, both through Firefox extensions and with the help of Greasemonkey.

But, and as many people don’t know, all major web browsers offer such a Greasemonkey option, but in various forms. Therefore, let me introduce you to Greasemonkey and userscripts, which basically are helper JavaScripts run through the help of Greasemonkey. Start with installing Greasemonkey (or similar tool) for your preferred web browser:

Firefox – Greasemonkey

Greasemonkey Safari Ios

Very simple, go to Greasespot, read a little about it and then install Greasemonkey.

Greasemonkey Internet Explorer

Safari – get SIMBL and GreaseKit

If you prefer Safari and is on a Mac, you can extend it with the help of something called SIMBL. It’s a little bit more tricky, i.e. no actual installer, but rather about putting some files in a certain location. Not too scary, but might put some people off.

Greasemonkey Safari Club

The upside of this is great, though! It enables fantastic services like those mentioned in Pimp My Safari and through GreaseKit it let’s you run userscripts as well.

Google Chrome – enable Greasemonkey functionality

What’s very exciting is that Google seemed to have thought about this with their Google Chrome web browser. If you follow the instructions in HOW TO: Install Google Chrome Greasemonkey Scripts (Windows Only), you can add userscripts to a c:scripts folder (create if needed) on your computer.

Note that the first step in the description isn’t necessary, though – just download the latest official version of Chrome and Greasemonkey will be built-in.

Opera – add userscripts

With Opera, there’s an easy way to point to a local folder on your computer for it to look after userscripts. Just follow the instructions in Opera: Tutorial – User Javascript and off you go!

Internet Explorer – IE7Pro

As with most tasks, Internet Explorer doesn’t really seem to be built for working, no matter what feature-area we’re talking about. However, with the help of IE7Pro you can add some extra functionality to it, and it also lets you run userscripts.

Please note, though, that most userscripts are written with standards-compliant web browsers in mind, meaning that due to improper event handling and such in IE, a lot of userscripts won’t work in it.

Userscripts

Greasemonkey Safari

Greasemonkey for ie

Greasemonkey Safari Park

Have you gotten your web browser ready and is eager to start out extending it? A first good tip is to go to userscripts.org and find any number of scripts suiting your needs. Bear in mind that all scripts there will work in Firefox, some will not work in Safari, Google Chrome and Opera and most will probably not work in Internet Explorer.

Basically, just test your way forward.

The state of web browser extending

While the above advice offers you help on how to make your favorite web browser become a little better with userscripts, it baffles me that Firefox is so far the only web browser with a proper extension architecture, and officially promoting this to the public. No doubt a huge part of the Firefox success comes from this, and they have achieved it in a great way.

So, the natural move for any other web browser vendor should be to offer this functionality as well, effectively competing with Firefox on the same level. And, if they’re smart, they do it in such a simple way as the Mozilla way, preferably with support for the same extension code, to encourage web developers to port their scripts to their web browser.

Therefore, all other web browsers should step up, right? Right.