2

I've been trying to transfer a lot of my Tampermonkey (in Google Chrome) userscripts to Greasemonkey in FireFox. Unfortunately, it seems that they don't work properly when I transfer them into Greasemonkey - I'm assuming there are syntactical differences, but I'm not sure what they are, nor have I found great information regarding the differences.

This code for instance:

// ==UserScript==
// @name     DailySearch
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @include  *
// @grant    GM_addStyle
// @grant    GM_openInTab
// ==/UserScript==

//--- Note that the contains() text is case-sensitive.
var TargetLink = $("a:contains('Daily Search')")

if (TargetLink.length)
    GM_openInTab (TargetLink[0].href);

This works in Tampermonkey on Chrome but not in Greasemonkey. What differences lie between the two, and how can I get this to work in FireFox?

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
theCrabNebula
  • 731
  • 2
  • 13
  • 29

1 Answers1

1

Which version of GM are you using?
GM4 uses GM.openInTab (GM3 used GM_openInTab)
GM_addStyle was dropped in GM4 (https://wiki.greasespot.net/GM_addStyle)

erosman
  • 7,094
  • 7
  • 27
  • 46