Copy Title and URL in single structure


Recommended Posts


I need a possibility to copy Title and URL of the Tab not separately (as in Maxthon now) but in single structure with two fields: Title and Address. I know Maxthon can do this. Therefore, I have decided to write the plugin. The problem is I am newbie in JS and WebKit.

I think I have to use a Tab.title and a Tab.url. But I cannot find how to copy it to the clipboard.

I have tried to search WebKit API and found this: But it is for html page's content not for WebKit Core.

Also, I cannot find how to define a keyboard shortcut for an addon.

Help, please.

Link to comment
Share on other sites

I've tried to do something very similar myself, and this is what I've come up with so far. It depends heavily on AutoHotKey. First, I assigned the "Copy Title and URL" action to Ctrl+Shift+z in Maxthon. Next, I added the following to my AutoHotKey script:$^+z::

send ^+z

IfWinActive ahk_class Maxthon3Cls_MainFrm


StringReplace, clipboard, clipboard, `r`n, =, All

FileAppend %clipboard% `r`n, f:\downloads\tabs.txt



returnThis code fires whenever you press Ctrl+Shift+z and re-sends the Ctrl+Shift+z (but doesn't fire itself in an infinite loop); if the active window is Maxthon (despite the Maxthon3Cls_MainFrm, this does work on Maxthon Cloud), it then reads the contents of the clipboard and replaces any newline with the equals sign (not a good idea for pages with equals signs in the URL, but works as a proof of concept), then appends the modified clipboard string to a file "f:\Downloads\tabs.txt"

Link to comment
Share on other sites


I have this old plugin from Max 2. Don't know if you can get it to work in Max now.

Good luck!:)


//* *

//* Created by mdlist *

//* Visit *

//* May be modified for personal use *

//* Please keep this credit *

//* *

//* ***********************************

var security_id=%max_security_id;

function no_error(){

return true;



var selectedtext='';















selectedtext = (selectedtext.replace(/^\W+/,'')).replace(/\W+$/,'');


if (selectedtext) selectedtext="%AB"+selectedtext+"%BB%0D%0A%0D%0A%0D%0A";

var mdlist=0;

var url,title;

var mailmessage = selectedtext;

var alltabs=external.tab_count;

for (mdlist;mdlist


if (external.get_tab(security_id,mdlist).document.title != ""){



else title="";

mailmessage += title + url + "\n\n";


mailmessage = unescape(mailmessage);


alert("The tabs info has been copied to the clipboard.");

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.