Skip to content


Subversion checkout URL

You can clone with
Download ZIP


"Show Script Source" should not throw when the script hasn't finished downloading yet #1586

Ventero opened this Issue · 4 comments

2 participants


Steps to reproduce:

  1. Click the link to a (preferrably very large) script - I've used for testing. For repeated tests, the cache has be cleared before clicking the link again.
  2. Immediately after the install dialog shows up, click "Show Script Source"

Expected result: Script source shows in new tab
Actual result: RemoteScript#showSource throws Script is not loaded!

When removing the check for _progress[0] < 1, everything seems to work as expected.

@Ventero Ventero referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.

I don't think this is the right solution; if the progress is < 1 then the file isn't downloaded yet, so you'll only be viewing a part of the source. Better is to disable the button until the script is downloaded.


That's what I thought at first, too. But the source always was complete (though admittedly, this might've simply been because the script finished downloading in the time after clicking "Show Script Source" and before it actually showed the source).
But disabling the button is probably the best solution either way.


Test case:

Click the .php to see what loads, the .phps to see how it is generated, and the .user.js to test Greasemonkey's behavior. If you click the script and then show source before it's done downloading, you only see the first few "benign" lines, and not the "evil" line at the end.


Ah, indeed. Thanks for the test case. I think then it's indeed best to disable the "Show Script Source" button while the script is still downloading (which would make it consistent with the install button, too).

@arantius arantius closed this in ec1e933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.