Nyheter, tanker og idéer

GMail Macros for Opera

23.04.2007 —

Finally I am able to switch back to Opera as my main browser. Now that Opera has content blocker and web developer tools, the only thing that have been missing was GMail Macros.

The original GMail Macros script is written as an Greasemonkey extension for Firefox by Mihai Parparita. I have ported to it Opera to be used as a user script. Download it, and put it under C:\Program Files\Opera\userjavascript\. Log in to GMail and press ‘h’ to see the list of available keyboard shortcuts. See also Mihai’s original blog post for details about the functionality.

What I have done is to remove and change Greasemonkey specific code in the original script.

  • All references to the ‘unsafeWindow’ object has been changed to ‘window’.
  • The reference to GM_addStyle has been changed so that it works for other browsers as well, including Opera of course.
  • The reference to style.MozOpacity has been changed to style.opacity.

It works like in Firefox, which means there are still some issues related to focus. If “the keyboard does not work”, then click somewhere inside the window.

Download it, and send me feedback!

As far as I know the original script is released under a BSD license, which means that so are my modifications.

UPDATE: If this is your first user script in Opera, then you must create the directory to store the scripts, and adjust your settings accordingly (Preferences -> Advanced -> Content -> Javascript options… >- User javascript files)

8 Responses to “GMail Macros for Opera”

  1. Gudinin Says:

    Dear Alf,

    Thank you much for your efforts of porting GMacros to Opera, and also for notifying me on lifehacker.com. I tried it today, immediately as I saw your note, but unfortunately I don’t see it working. I tried it with both http and https, also restarting Opera, but… :(

    Activating the Error Console gave me the following notification:
    User JS compilation
    Syntax error C:\Program Files\Opera\userjavascript\GmailMacrosOpera.user.js: line 1 of User JS script :
    sro 02>tTrai”

    Seems nonsense, because there are no such characters in the file.

    Would you have an idea what could be a problem? Or better yet, could you hint what to do to fix this? If you have time, of course.

    Thanks a lot!

  2. Alf Kåre Says:

    Thanks for feedback!

    I suspect it has something to do with character encoding and transfer over HTTP. On server it is stored encoded as UTF-8, with leading byte order mark.

    You can try to download a zipped version of the script, or the ASCII version.

  3. Gudinin Says:

    Man, you made my day!!! (Or should I say night :)

    Really, it was difficult to believe it, after so many months of trying to find a solution! Very cool to finally have this tool working!

    You were probably right about encoding. I took the zipped version and didn’t even have to go further – worked like a charm! I have to add that I’ve changed the encoding in my Opera to “Automatic Selection”, as some time ago I had to select a specific one, and forgot that I didn’t revert back.

    Many thanks, Alf, I greatly appreciate your efforts!!!

  4. Frank Says:

    Takker for et kjekt script. Har begynt å bruke GMail ganske mye, så alt som kan gjøre det enklere er greit å ha.

    Tipset også Google Tutor om at du har “oversatt” scriptet til Opera, http://www.googletutor.com/2007/06/19/empowering-your-gmail-with-firefox-and-greasemonkey/

  5. Frank Says:

    Hmmm. Ser ikke ut som om de godkjente kommentaren min der jeg tipset om portingen din…

  6. Ray Says:

    Huge thank you for this! I’ve been leaning towards switching to Opera for some time and this really tipped the scale and made it an easy choice. Thanks again!

  7. kyleabaker.com » Blog Archive » Handy User Javascripts for Opera Says:

    […] Gmail Macros for Opera […]

  8. Sam Says:

    Does not seem to work for me on the latest; oh well! Gmail keeps on changing their APIs and so forth. Anyone updated their versions? I’m trying to switch from firefox and need my macros!