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
Drag'n' drop into AOM: This add-on could not be installed because it appears to be corrupt #1663
Comments
The farthest I got today is that maybe if we registered part of the right category: |
This seems to be caused by the hardcoded "application/x-xpinstall" MIME type in Scriptish hooks into |
Yeah, that calls AddonManager.getInstallForURL() with xpiinstall in the third argument. As I read the source, that just calls 'supportsMimetype' calls with that value, at least. But I don't see any. Maybe I'm reading something wrong, it's a lot of spaghetti callback stuff. I'd like to avoid monkeypatching if there's a supported API. But might have to resort to it. |
Yeah, the reason you're not seeing any calls is because the XPIProvider's callback is called first (probably because it registered earlier or something), and getInstallForURL returns after it found the first addon provider that accepts the passed MIME type. So basically the call chain is: AddonManager.getInstallForURL -> ... -> XPIProvider.supportsMimetype (returns true) -> XPIProvider.getInstallForURL (which throws and triggers the dialog) -> end whereas the correct one would be AddonManager.getInstallForURL -> ... -> XPIProvider.supportsMimetype (returns false) -> GM's AddonProvider.supportsMimeType (returns true) -> etc. So it looks like unless upstream changes |
Ah, absolutely. Somewhere else (I did a lot of back and forth trying to trace this) there was some sort of async-callback iterator thing; I missed that this was a for..let here, which definitely has that behavior. |
If we call the original dragdrop handler, then we get the 'corrupt' notice. If we don't (when there is a When there is any |
I think the original handler should still be called, however the |
Trying to
|
Mhh, indeed, see this comment on Mozilla's bugzilla. Not sure how to handle it then, other than not calling the original handler when at least one userscript is dropped onto the page. But even that would be better than not handling userscripts at all - especially because I don't think it happens very often that someone tries to drop an XPI and a userscript at the same time. |
I picked calling the default handler when and if there is at least one non- user script; this will still throw the message, but should install both, if a |
Reported on the -users list:
Confirmed that this happens in the AOM but not a tab at a web page.
The text was updated successfully, but these errors were encountered: