Greasy Fork is available in English.
Display a confirmation dialog when the site wants to open a new tab, so that user has the chance to cancel or allow it to open in a new or current tab. This script won't work if the user opens a link in a new tab using web browser's "Open in a new tab", "Open in background tab", or similar which are web browser internal or browser extension features.
The rejectList and allowList contains the list of source-target rules. The main purpose of these listsis to provide an automated action on whether opening a new tab is allowed or not. Any matchingrejectList rule will reject the new tab to open without prompting the user. Any matching allowList rulewill allow the new tab to open without prompting the user.
rejectList has higher priority than allowList. Each source-target rule is an array of two values:SourceURL then TargetURL. SourceURL denotes the current tab's URL, while TargetURL denotes thenew tab's URL.
Both source and target URL values can be either a string type or a regular expression object. Each willbe compared against the whole URL.
If string type is used, it must match the whole URL instead of part of it. The comparison is donewithout case sensitivity (i.e. character case is ignored). A *
wildcard can be used to match any oneor more characters. e.g.:
"*"
will match any URL.
"*://www.site.com/*"
will match against http://www.site.com/
includinghttp://www.site.com/home
.
"www.site.com"
will never match against http://www.site.com/
.
"*www.site.com*"
will match against http://www.site.com/
but also againsthttp://www.proxy.com/?url=http://www.site.com/
.
"*://*/*www.site.com*"
will match against http://www.proxy.com/?url=http://www.site.com/
but not against http://www.site.com/
.
"*url=*www.site.com*"
will match against http://www.proxy.com/?url=http://www.site.com/
but also against http://www.proxy.com/?url=http://www.other.com/&alt=http://www.site.com/
.
If regular expression object is used, it may match only part of the whole URL, depending on the regularexpression pattern itself. The comparison is done with or without case sensitivity, depending on theregular expression flags.
A source-target rule will match if the source and target URLs matches.