Help - Search - Members - Calendar
Full Version: MT It! Not Working
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
zimmer
Has anyone else installed the latest IE6 security updates and now are having problems with the MT It! feature?  I'm getting a error stating 'external.menuArguments.document' is null or not an object.  The url in question is java script:d=external.menuArguments.document;t=d.selection?d.selection.createRange().text:d.getSelection();void(window.open('http://www.richardz.com/blog/lib/mt.cgi?

I have tried reinstalling the bookmarklets and restarting the computer but no luck.  This might be an issue that should be addressed in v2.6
zimmer
I've updated to version 2.62 and still have the problem with the MT It! right click option in IE6.  However the bookmark feature of MT It! in the favorites does work.  It appears others are having the same problem exactly as I described.
philringnalda
(GRRR! Three times I've had to use IE6 today. That's three too many.)

Interesting. I hadn't looked at how the MT It! version was doing it - nice that that scheme worked for a while.

Background: back when IE6 first came out, it broke Blogger's context menu BlogThis! with a permission denied error. That turned out to be because scripts in the security context of an external file called from the registry (it was a script hosted on the Blogger server) were no longer allowed to access the calling page's location from external.menuArguments.document.location.href, but instead had to access external.menuArguments.location.href. Shame we didn't find out that an inline script in the registry could do the job, and could access either one, since we couldn't convince Ev to make the tiny change it needed and I now own the term blogthis on Google thanks to hosting some huge Windows installer programs to just save a tiny script file on your computer and make a registry entry pointing to it.

However, it looks like now you can't access external.menuArguments at all from a script inline in the registry, and MT's going to have to go the same "registry entry points to an external file" route, though thank Ghu this time I shouldn't have to host giant installers. The script can be saved on the user's server, and the registry entry pointed at it there, or saved on the local computer, whichever seems easier. The only change is that you have to get the URL from external.menuArguments.location.href, so it should work (well, it does work) to use something along the lines of


<script type="text/javascript">
e=external.menuArguments;
l=e.location.href;
d=e.document;
t=d.selection.createRange().text;
bmwin=window.open('http://www.example.com/mt/mt.cgi?is_bm=1&bm_show=category&__mode=view&_type=entry&link_title='+escape(d.title)+'&link_href='+escape(l)+'&text='+escape(t),'_blank','scrollbars=no,width=410,height=490,status=yes,resizable=yes,scrollbars=yes');
bmwin.focus();
</script>


either saved on your computer with the registry entry changed to C:\wherever\mtit.js or saved on your server with the registry entry being http://www.example.com/mt/mtit.txt (note that it's not .js, because if it's served as application/x-javascript then IE won't interpret it as javascript, but if it's served as text/plain it will, and have I mentioned how much IE drives me crazy? Their security model must be based on giving a kitten a skein of yarn, and then trying to model the result.)

Edit note: if you are viewing this in IE6, the line starting bmwin= should all be one line, with a cute overflow:scroll style. Maybe IE7 will be out before too much longer.
zimmer
Ok, This is what I did following 'philringnalda' structure.

1) Created a .js file to be stored somewhere on my hard drive.  First I made a .txt file and inserted the following code from 'philringnalda'
CODE
<script type="text/javascript">
e=external.menuArguments;
l=e.location.href;
d=e.document;
t=d.selection.createRange().text;
bmwin=window.open('http://www.example.com/mt/mt.cgi?is_bm=1&bm_show=category&__mode=view&_type=entry&link_title='+escape(d.title)+'&link_href='+escape(l)+'&text='+escape(t),'_blank','scrollbars=no,width=410,height=490,status=yes,resizable=yes,scrollbars=yes');
bmwin.focus();
</script>


2) Changed the url http://www.example.com/mt/mt.cgi to point it directly to the mt.cgi on my server (for all the morons out there like me this is the exact location you log into for your blog).

3) The current preferences as set in the code above were not how I wanted my MT window to appear (for example extended entry, excerpt, keywords and text formatting (v.2.62)).  So I went to the original registry entry (step 6 explains where to find it) and copied everything from 'mt.cgi' to '(d.title)' and pasted it into the exact area of the new code (as seen above).

4) Saved the .txt file and changed the extension to .js (you may have to adjust Windows setting to allow you to see your files extensions if you don't already, this is found under tools>folder options in the file explorer window).

5) Save the .js file to a location.  I saved mine at c:\WINDOWS\WEB\mt.js (mt.js is the file name I saved it as).

6) Alter the registry entry found at HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\MT It!.  Go to start and run and type 'regedit' and navigate to the above location.  Alter the file in the right pane that says (Default) and the icon is colored red.  After double clicking I altered the information to 'c:\WINDOWS\WEB\mt.js'.

Voila!

Thanks philringnalda for the know how,

Zimmer
karavshin
So I tried to implement this for v2.51, but having some problems.

first, here is my "mt-this.txt" file
QUOTE
<script type="text/javascript">
e=external.menuArguments;
l=e.location.href;
d=e.document;
t=d.selection.createRange().text;
bmwin=window.open('http://karavshin.org/scgi-bin/mt/mt.cgi?is_bm=1&bm_show=category&__mode=view&_type=entry&link_title='+escape(d.title)+'&link_href='+escape(d.location.href)+'&text='+escape(t),'_blank','scrollbars=no,width=400,height=490,status=yes,resizable=yes,scrollbars=yes');
bmwin.focus();


(when I preview this message the closing 'script' tag doesn't appear.  It IS in the actual file, howerver)

then I adjusted my registry entry 'Value data' to be
QUOTE


then I start up a fresh IE, do the right-click-MT-This! command and get a javascript error:

Line:6
Char: 1
Error: Permission Denied
Code: 0
URL:  http://karavshin.org/special/mt-it.txt

Ideas?
robeauch
Thanks, philringnalda and Zimmer! This issue has been driving me crazy and I wish I'd checked the support forum first before wasting my own time.

Karavshin, two questions about your permission error: (1) I notice you mention the file-name as "mt-this.txt" but you say you changed the registry entry to "mt-it.txt". Was that just a typo? If not, fixing the file name might take care of things. And (2), I don't know if the file needs special permissions or not, but just in case, you might check to see if it's set to 775.

Thanks again!
zimmer
Maybe just scrap putting it on the server thing.  When I was looking at the other registry entries in the same folder with MT It! I noticed none of the others were on a seperate server rather in my windows/web folder.  

Is anyone else having success with this work around and are you putting the file on your server or on your computer?
philringnalda
Ah, yes, for an individual fix, unless you are planning on using the same file from a lot of different computers I'd just go with a local file, since otherwise you'll have to connect to your server, get the script file, which will then connect to your server... I was mostly talking to Ben about saving on the server, since it might be easier to implement saving a file on your server from MT, rather than having to deliver both a .js and a .reg file for new installs in some future version.
karavshin
I moved the file back to my pc, instead of leaving it on the web server.  I am getting a similar error.
Screenshot of the the registry, error, and script (same as above)

I'm probably being dumb about something here... I apologize in advance sad.gif
zimmer
Karavshin, replace everything starting on the sixth line, between 'bmwin=window.open' and 'scrollbars=yes');' with the following code,

CODE
t=d.selection.createRange().text;bmwin=window.open('http://karavshin.org/scgi-bin/mt/mt.cgi?is_bm=1&bm_show=category&__mode=view&_type=entry&link_title='+escape(d.title)+'&link_href='+escape(l)+'&text='+escape(t),'_blank','scrollbars=no,width=400,height=490,status=yes,resizable=yes,scrollbars=yes');
jmarston
I wasn't having any luck because my registry was

CODE
javascript:d=external.menuArguments.document;t=d.selection?d.selection.createRange().text:d.getSelection();void(window.open('d:\ACCOUNTS\mt\mtscript.txt'))


it should have been just
CODE
d:\ACCOUNTS\mt\mtscript.js


using the txt on my local system didn't work on my ie6 xp

Thanks guys!
karavshin
Thanks all, thanks to Zimmer and others' help, my MT It! w/ XP and IE6 is back to working...  for the record, here is the working script...

QUOTE
<script type="text/javascript">
e=external.menuArguments;
l=e.location.href;
d=e.document;
t=d.selection.createRange().text;
bmwin=window.open;

t=d.selection.createRange().text;bmwin=window.open('http://

karavshin.org/scgi-bin/mt/mt.cgi?is_bm=1&bm_show=category&__mode=

view&_type=entry&link_title='+escape(d.title)+'&link_href='+escape(

l)+'&text='+escape(t),'_blank','scrollbars=no,width=400,height=490

,status=yes,resizable=yes,scrollbars=yes');

bmwin.focus();
< / script >


(you need to fix the closing 'script' tag -- it wasn't agreeing witht he quote text...)


My registry entry is:

QUOTE
c:\WINDOWS\WEB\mt-it.js
tchansen
Thanks, philringnalda and Zimmer for finding and fixing this problem! I'm using WindowsXP, service pack 2 and I just updated to the latest security patches to fix some new holes - which broke my MTit!

Fortunately a quick search led me here - I run the script locally and it works just fine. I'm using philringnalda's script and thanks to Zimmer for the registry entry. Took about 5 minutes to fix. Also, it is much, much faster now to pop up

However, I did notice one other change. With the version of MTit! installed from the Bookmarklets I didn't have to log in first. Now I do. I don't have MT remember my login (I'm a security nut) but I may have to on this one. Any ideas?

Thanks again for your help,

chris
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.