7twenty Posted December 11, 2015 Report Share Posted December 11, 2015 So i've been looking at some extensions and trying to figure out some things, but javascript is for the most part a little over my head. Reading some books to see if it makes any more sense. Can anyone give me a quick rundown on how to do something as simple as close the current tab? I get that this first two lines need to be in the script to create a runtime for the rest to work in, but then it gets hazy? var rt = window.external.mxGetRuntime(); var browser = rt.create("mx.browser.tabs"); mx.browser.tabs.getCurrentTab() Tab.close() Line 3 should be "browser.getCurrentTab()" to get the current tab as it uses the browser variable? what next? Where does Tab.close() fit in? Do i need to create a function for this to work? Link to comment Share on other sites More sharing options...
7twenty Posted December 13, 2015 Author Report Share Posted December 13, 2015 2 days, and no response.... well I think that shows just how many more technically inclined users there are here. Link to comment Share on other sites More sharing options...
Tony Posted December 13, 2015 Report Share Posted December 13, 2015 i'll respond - only to say sorry i have no idea - javascript is a mystery to me - i think any that had knowledge have long since left - who in truth can blame them - it would be nice if one of the devs commented but thats asking far to much - its back to the one way street Tony - Vivaldi 4 on Windows 10 64Bit Link to comment Share on other sites More sharing options...
大笨狗 Posted December 14, 2015 Report Share Posted December 14, 2015 Try this: var myRuntime = window.external.mxGetRuntime(); var mxTabs = myRuntime.create('mx.browser.tabs'); var currentTab = mxTabs.getCurrentTab(); currentTab.close(); 1 Link to comment Share on other sites More sharing options...
PHYR Posted December 14, 2015 Report Share Posted December 14, 2015 (edited) 3 hours ago, 大笨狗 said: Try this: var myRuntime = window.external.mxGetRuntime(); var mxTabs = myRuntime.create('mx.browser.tabs'); var currentTab = mxTabs.getCurrentTab(); currentTab.close(); Hmmm, recognize the flower, thanx dev! Edited December 14, 2015 by PHYR Link to comment Share on other sites More sharing options...
SnowLeopard Posted December 14, 2015 Report Share Posted December 14, 2015 (edited) 3 hours ago, PHYR said: Hmmm, recognize the flower, thanx dev! Likewise, I recognize the flower and the Chinese name, but didn't realize he's a dev (meaning Maxthon dev). I do know his skin work, very good and I'm still using one (Bing_Light) with some tweaks. <<SL>> Edited December 14, 2015 by SnowLeopard Link to comment Share on other sites More sharing options...
7twenty Posted December 15, 2015 Author Report Share Posted December 15, 2015 On Tue Dec 15 2015 00:03:21 GMT+1100 (AUS Eastern Summer, 大笨狗 said: Try this: Thanks for that Amazingly the rest just seemed to fall into place once that was explained to me. Learnt a few things which is nice! Link to comment Share on other sites More sharing options...
Recommended Posts