ID:2245350
 
Lately I have been making a kind of "frankenbrowser" to extend the functionality of Dream Seeker's horrible built-in browser. Even byond.com is displayed wrong by default.

I discovered that the meta tag can modify the way an iframe is displayed. This means we can force many sites to display in edge mode and get around the normal limitations of the browser. Unfotunately, many sites understandably don't like being shown in iframes. This will give you an idea of how that works:
mob/Login()
..()
client.BrowseSite("byond.com")

client/verb/BrowseSite(url as text)
if(url)
if(findtext(url, "http") != 1)
url = "http://[url]"
src << browse({"\
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<iframe src="
[url]" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;"></iframe>
"}
, "window=BrowseSite;size=1024x824")
winset(src, null, "command=BrowseSite")

client/verb/BrowseSiteNoFrame(url as text)
if(url)
if(findtext(url, "http") != 1)
url = "http://[url]"
src << browse({"\
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript">
window.location = "
[url]";
</script>
</head>
"}
, "window=BrowseSiteNoFrame;size=1024x824")
winset(src, null, "command=BrowseSiteNoFrame")

I'm hunting for a better solution. I have some partially working DM code that converts and replaces all relative urls with direct ones for any given page. It also converts them to byond urls to route them all through client.Topic(). The idea there is to modify and display all pages locally. Since that's guaranteed to be incomplete, buggy, and slow, I'm planning out a pure JavaScript solution.

I hacked Firebug Lite to make it run locally in a browser control. I had to modify it because browse_rsc() cannot create new subfolders within the client's cache folder, and Firebug likes to use subdirectories.

I plan to put together some kind of JavaScript plugin system to make it easier to add new JS libraries. I'm hoping to get a CoffeeScript or Python interpreter library up and running so that I don't have to worry about all of those annoying braces and semicolons anymore. So far, my efforts to run another language have only given me errors pointing to something that I don't understand. It's so far beyond the scope of BYOND or any sane use of JavaScript that I don't even bother to ask, but that's what I get for working with niche software!

So far, I also have basic tabbed browsing that allows me to create and destroy any tab at runtime. I will eventually scrap the interface tabs to implement proper rearranging by dragging, which could take the form of either screen objects in an extra map control, or possibly some kind of JavaScript running in a browser control. The tab system could be used in many other cases than just a browser.

This might all sound crazy, until you realize that BYOND stands for "Build Your Own Net Dream", even though its browser is barely functioning. Let's see if I can bring it back from the dead.