From 2563ecf6d8518f632b370228c98742c6b71e1174 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Wed, 14 Mar 2018 19:48:46 +1300 Subject: [PATCH 1/2] Greasemonkey: add FAQ entry. The most common questsions regarding greasemonkey support on IRC are "how do I use it" and "why doesn't my script work", hopefully this can be a starting point for most people experiencing issues. --- doc/faq.asciidoc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 9b3f210ea..1c06d690a 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -212,6 +212,35 @@ Why takes it longer to open an URL in qutebrowser than in chromium?:: qutebrowser if it is not running already. Also check if you want to use webengine as backend in line 17 and change it to your needs. + +How do I make qutebrowser use greasemonkey scripts?:: + There is currently no UI elements to handle managing greasemonkey scripts. + All management of what scripts are installed or disabled is done in the + filesystem by you. qutebrowser reads all files that have an extension of + `.js` from the `/greasemonkey/` folder and attempts to load them. + Where `` is the qutebrowser data directory shown in the `Paths` + section of the page displayed by `:version`. If you want to disable a + script just rename it, for example, to have `.disabled` on the end, after + the `.js` extension. To reload scripts from that directory run the command + `:greasemonkey-reload`. ++ +Troubleshooting: to check that your script is being loaded when +`:greasemonkey-reload` runs you can start qutebrowser with the `--debug` +argument and check the messages on the program's standard output with the +`greasemonkey` facility. If there are javascript errors with your script you +may also see messages with the `js` facility. ++ +Note that there are some missing features which you may run into: + +. Some scripts expect `GM_xmlhttpRequest` to ignore Cross Origin Resource + Sharing restrictions, this is currently not supported so scripts making + requests to third party sites will often fail to function correctly. +. If your backend is a QtWebEngine version 5.8, 5.9 or 5.10 regular expressions + are not supported in `@include` or `@exclude` rules. If your script uses them + you can re-write them to use glob expressions or convert them to `@match` + rules. See https://wiki.greasespot.net/Metadata_Block[the wiki] for more info. +. Any greasemonkey API function to do with adding UI elements is not currently + supported. That means context menu extentensions and background pages. == Troubleshooting From e5edc0f940985797c33eba288021b582f2db97c7 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Wed, 14 Mar 2018 20:19:51 +1300 Subject: [PATCH 2/2] fixup! Greasemonkey: add FAQ entry. Change the wording and the `--debug` suggestion. Add comma after "this is currently not supported", I was tempted to add a semicolon before it to but I resisted. Added a "then" after QtWebEngine version list, not a comma. --- doc/faq.asciidoc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 1c06d690a..5fd36d67b 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -225,20 +225,22 @@ How do I make qutebrowser use greasemonkey scripts?:: `:greasemonkey-reload`. + Troubleshooting: to check that your script is being loaded when -`:greasemonkey-reload` runs you can start qutebrowser with the `--debug` -argument and check the messages on the program's standard output with the -`greasemonkey` facility. If there are javascript errors with your script you -may also see messages with the `js` facility. +`:greasemonkey-reload` runs you can start qutebrowser with the arguments +`--debug --logfilter greasemonkey,js` and check the messages on the +program's standard output for errors parsing or loading your script. +You may also see javascript errors if your script is expecting an environment +that we fail to provide. + Note that there are some missing features which you may run into: . Some scripts expect `GM_xmlhttpRequest` to ignore Cross Origin Resource - Sharing restrictions, this is currently not supported so scripts making + Sharing restrictions, this is currently not supported, so scripts making requests to third party sites will often fail to function correctly. -. If your backend is a QtWebEngine version 5.8, 5.9 or 5.10 regular expressions - are not supported in `@include` or `@exclude` rules. If your script uses them - you can re-write them to use glob expressions or convert them to `@match` - rules. See https://wiki.greasespot.net/Metadata_Block[the wiki] for more info. +. If your backend is a QtWebEngine version 5.8, 5.9 or 5.10 then regular + expressions are not supported in `@include` or `@exclude` rules. If your + script uses them you can re-write them to use glob expressions or convert + them to `@match` rules. + See https://wiki.greasespot.net/Metadata_Block[the wiki] for more info. . Any greasemonkey API function to do with adding UI elements is not currently supported. That means context menu extentensions and background pages.