I consider this a bug and something seriously needs to be done about it.
We should be able to do ANYTHING we want with and within a "bookmarklet".
When I try to execute a bookmarklet that opens a new window and attempts to
create a script object to load a LOCAL JavaScript library, I get the following error
on some web pages (some, but not all, https:// protocols) as noted in the
error console:
[TimeShownHere] Blocked loading mixed active content "...with the "offending" bookmarklet code here..."
The part of the bookmarklet code that is causing the error is:
Code: Select all
window.BookmarkletFunc = 'BookMarkletLibraryFunctionToExecute';
var oScript = document.createElement ('script');
oScript.onload = function() { window[window.BookmarkletFunc ](); };
oScript.type = 'text/javascript';
oScript.src = 'http://127.0.0.1/location/libraryname.js?' + Math.floor (Math.random() * 99999);
document.getElementsByTagName ('head')[0].appendChild (oScript);
(as opposed to 'obfuscated' code in a bookmarklet; I use a "standard calling procedure" as above)
On the one hand, it is nice that a bookmarklet opens a window with reference to the page
that is active when the bookmarklet is clicked. However, since we are in effect executing
'local code', we should have more power with what we are able to do.
This only became a problem in the last several months.
(probably because a "security issue" was "fixed")
If there is a viable work-around, that would be acceptable.
However, as I stated, we should be able to do anything we want with a bookmarklet
and not be hindered in any way, shape, or form.
That is common sense.