New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the (default) scratchpad editor leaves confusing "run" menu items #1771
Comments
Update: Have installed Firefox 22 to test whether it's IceWeasel-specific, and it appears not to be. |
Your script gives me this error:
This works for me:
|
Sorry, must have misnamed var. Never saw the error my end as the GM functions never run anyway. hurda notifications@github.com wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
Oh, I just saw the Scratchpad-Errors. |
Do not pick "run" in scratchpad unless your script is I worried a bit about this early on. I suppose we'll have to hide those menu options when you're editing a user script to avoid confusion. |
Quite right about the scratchpad issue, sorry. In my innocence I thought GM was launching scratchpad with some background hack to enable testing with "run". However, despite now having GM_log and GM_xmlhttpRequest appear successfully in my code, GM_log still does not work (GM-xhr works fine!). Here's the code I've written for Bandcamp: You can see at the outset that I detect GM_log and test it, but proceed with using console.log. To date I have never seen GM_log output, which was part of my original confusion in this issue: I'd been using GM_log to test whether GM_xmlhttpRequest was being detected, and its output! To clarify prior to FAQs: I have modified the appropriate about:config settings as directed in the wiki to make GM_log function correctly, and while I do have firebug installed I have also been looking in the "normal" log. Should I open a new issue with this, considering that I've narrowed down my problem considerably? For the record, this issue is affecting me with FF22 as well as Iceweasel 20. GM 1.1 in both cases, I think. |
Derp, never linked to referred-to code: |
I've taken this part of the script, and it's working fine with and without the @grant:
Log-messages: http://i.imgur.com/aPYgRAZ.png Whatever the cause of your problem is, it's not in GM or the script. |
It's worth leaving this issue open to track what happens when selecting the "run" scratchpad commands. I've thought about improving that in the past, and this confirms that it's valuable. Creating a separate issue to track whether/how GM_log is broken is valuable. |
OK, new issue opened. Thanks for help here! |
In removing the menu items that are nonsensical to a new user, the thing that the scratch pad is useful for is gone. If you use an external editor with out a syntax checker the scratch pad inspect is the first thing to use to show you your missing parameters or miss typed or incorrectly capitalized words.I just updated grease and now have to go back to the previous version. |
Hello,
Recently started using Greasemonkey, and am really enjoying it already. So far, almost everything works fine for me; metadata is correctly parsed to get @includes, @name, @description, etc.
I have yet to use or try @require, but I have discovered that @grant appears not to work. Below is some example code. Removing all @grant statements doesn't make auto-inference work, so I have been so far unable to use any GM_ functions.
I'm using Greasemonkey 1.10 on IceWeasel, a rebranded form of Firefox, version 20:
http://www.geticeweasel.org/
Compatibility should not be an issue; the changes made to IceWeasel are minimal and all other extensions and features of Greasemonkey work well..
Scratchpad:
// ==UserScript==
// @name testgrants
// @namespace http://foo.bar.tld/asdfghjkl
// @description Testing whether or why "@grant" statements are not working in GM1.10 in IceWeasel 20.
// @include http://*
// @include https://*
// @Version 1
// @grant GM_log
// @grant GM_xmlhttpRequest
// ==/UserScript==
//;
// First error message below is with this log statement uncommented;
// recommented to demonstrate bug with GM_xmlhttpRequest
//GM_log("Making xhr request to get final location of 'bit.ly/qwerty'");
GM_xmlhttpRequest({
url: "http://bit.ly/qwerty",
method: "HEAD",
synchronous: true,
onload: function(response) {
var final;
}
});
GM_log("Final url: " + final);
/*
Exception: GM_log is not defined
@Scratchpad/3:14
/
/
Exception: GM_xmlhttpRequest is not defined
@Scratchpad/3:16
*/
The text was updated successfully, but these errors were encountered: