I have been having a problem with "Bookmarklets" using IE9 x32 on Windows 7 Home Premium x64.
I have a rather complex bookmarklet that works on IE9 x64 but fails on IE9 x32. It also worked fine on a previous computer (XP SP3 x32) using IE6 and IE7.
I reduced it and ended up with this:
javascript:(function(){var x=window.open();x.document.write('<html><head><title>Testing</title></head><body><pre>Hello !!<br></pre></body></html>');})();
"Formatted" for easier reading, it looks like:
javascript:
(function(){
var x=window.open();
x.document.write('<html><head><title>Testing</title></head><body><pre>Hello !!<br></pre></body></html>');
}
)();
Putting this in a bookmark, I find that it still works on IE9 x64 and still fails on IE9 x32.
I expect that it should open a new browser window (or tab) and display the text:
Hello !!
It does so on IE9 x64, but on IE9 x32, it opens a new blank window (or tab), but does not display any text.
I had the same problem on this machine using IE8, but I have since upgraded to IE9.
I asked this question on another forum, and received some suggestions. Implementing those suggestions, I end up with this:
javascript:(function(){var x=window.open("about:blank");x.document.open();x.document.write('<!-- saved from url=(0014)about:internet -->\n<html><head><title>Testing</title></head><body><pre>Hello !!<br></pre></body></html>');x.document.close();})();
"Formatted" for easier reading, it looks like:
javascript:
(function(){
var x=window.open("about:blank");
x.document.open();
x.document.write('<!-- saved from url=(0014)about:internet -->\n<html><head><title>Testing</title></head><body><pre>Hello !!<br></pre></body></html>');
x.document.close();
}
)();
Again, this bookmark, still works on IE9 x64 and still fails (in the same way as before) on IE9 x32.
I have reviewed all the settings from Tools-->Internet Options and everything looks correct.
I have also done a reset of IE: Tools-->Internet Options-->Advanced-->Reset. This had no effect.
And, I have already tried disabling all add-ons ("C:...\iexplore.exe" -extoff). Again, no effect.
It appears that the "x.document.write(...)"
is basically being ignored on IE9 x32. So, I assume that it is some sort of security setting but since it works in IE9 x64... it would seem to have to be a something that has a setting specifically for x64 and x32, I don't know where to begin.
I tried to debug this (x32) with MS Developer tools. In my First (simplest) example, the debugger always stops (break) at the x.document.write(...) statement, and the error message I have seen is "The tag is invalid.". With the debugger, there are no errors using IE9 x64.
In my Second (last) example, the debugger always stops (break) at the x.document.open statement, and the error message I have seen can be either "Access Denied" or "The tag is invalid.".
There is some "history" of my problem along with some screenshots here:
Favlet (aka Bookmarklet) failing on IE 8-ecac-
and here:
Favlet (aka Bookmarklet) failing on IE 8-af33-
Tools-->Internet Options-->Security-->Local Intranet-->Enable Protected Mode:unchecked
(Tools-->Internet Options-->Security-->Internet-->Enable Protected Mode:checked)
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_LOCALMACHINE_LOCKDOWN:iexplore.exe=REG_DWORD 0x00000000 (0)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0:1400=REG_DWORD 0x00000000 (0)
I ran into this issue, and it's not actually under settings. It has to do with IE using the wrong dll to handle the window.open()
functionality.
As admin, run regsvr32 /u C:\Windows\SYSWOW64\DOCOBJ.DLL
from the system32 folder.
Then run regsvr32 "C:\Program Files (x86)\Internet Explorer\IEPROXY.DLL"
.
This worked quite will for me and window.open()
now works correctly.
User contributions licensed under CC BY-SA 3.0