Rob_Wu Posted May 18, 2014 Report Share Posted May 18, 2014 In Retro mode, the extension platform is extremely unreliable. The methods of external.mxGetRuntime() are only valid while the script is being executed for the first time. Any asynchronous JavaScript code that attempts to use external.mxGetRuntime() either fails with a hard error, or just results in undocumented behavior. For instance: var mxStorage = window.mxGetRuntime().storage; mxStorage.setConfig('key', 'value'); // succeeds, returns undefined var value = mxStorage.getConfig('key'); // succeeds, returns value setTimeout(function() { var value = mxStorage.getConfig('key'); alert(value); // "false" ??? }, 4); XMLHttpRequest cannot be used to perform cross-origin HTTP requests (though it works in Ultra mode). And because of the previous bug, I cannot delegate cross-origin AJAX to the background page. Bottom line - cross-origin AJAX is near-impossible in Maxthon (Retro mode). And finally, scripts are not inserted when a Retro tab is loaded for the first time, or when it is reloaded (F5). I guess that you're using NAVIGATECOMPLETE2 and/or DOCUMENTCOMPLETE to detect page loads. This is not sufficient, because it fails to detect page reloads. One way to solve it is to maintain a data structure that keeps track of the state of the tabs, and use TITLECHANGE and/or STATUSTEXTCHANGE to detect potential page reloads. Please document the limitations of your extension platform in Retro mode. (Last year, someone posted a review of your extension platform at http://forum.maxthon.com/thread-1618-1-1.html. I hoped that the platform has improved since then, but unfortunately it does not.) Tip Give Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.