-
Notifications
You must be signed in to change notification settings - Fork 326
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
Cannot use an image file that is locally downloaded via @resource, as an icon in a input
element
#2341
Comments
I installed exactly that script (except Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0 |
Confirmed (the original problem) on: Windows 7/8.1, Ubuntu 15.10 // ==UserScript==
// @include https://greasyfork.org/en/users/2160-darkred
// @grant GM_getResourceURL
// @resource icon http://i.imgur.com/ZU0xS0c.jpg
// ==/UserScript==
var referenceNode = document.querySelector('div.width-constraint:nth-child(2) > h2:nth-child(1)');
var a = document.createElement('input');
referenceNode.appendChild(a);
a.style.padding = '0px 12px';
a.setAttribute('type', 'image');
a.setAttribute('src', GM_getResourceURL('icon') ); // or a.src = GM_getResourceURL('icon') See pull request: #2342 And the proof is: From: if (resource.url) { To: GM_util.logError("resource.url (hasOwnProperty): "
+ resource.hasOwnProperty("url") + " : "
+ (resource.url ? resource.url : "NO")
+ ", resource.file_url (hasOwnProperty): "
+ resource.hasOwnProperty("file_url") + " : "
+ (resource.file_url ? resource.file_url : "NO"));
if (resource.url) { The result in the Browser console: |
Thanks! Happened to have e10s off before, keep switching it back and forth because some bugs only happen with it off. |
As a continuance to this stackexchange question
(Using Firefox Nightly 45.0a1 (2015-12-14) x64 with a fresh profile,
and Greasemonkey 2015.11.20.nightly
in win10x64 )
I have this script for greasemonkey to add a
send PM to user
"button" (which is essentially aninput
element)to e.g. this page https://greasyfork.org/en/users/2160-darkred
My code that currently adds the "button" successively is:
I want to change the code, so that the button icon is downloaded once (as
@resource
) instead.So, based on this and this, I tried to change my code into:
The problem is that the "button" now doesn't use the
icon
file(its displayed as text: '
Submit Query
' instead).There's no relevant entry in Browser Console.
PS. In Firefox 43 and Greasemonkey nightly and Tampermonkey/Chrome this doesn't occur.
The text was updated successfully, but these errors were encountered: