ID:195095
 
//Title: Viewing Webpages in the Dream Seeker Browser tab
//Credit to: Wizkidd0123
//Contributed by: Wizkidd0123

/*
The built-in link() function is one way to send the user to
a website; however, it isn't necessarily the best choice
interface-wise. Instead of utilizing Dream Seeker's built-in
Browser tab to that website, link() actually opens a new
browser window.

In general, I find that when the website is part of a
game (e.g., game directions), it's better to keep it
in the same window as the game (in other words,
to open the website in the Dream Seeker browser tab).
Since BYOND has no built-in function to do this,
I wrote a snippet:


Arguments:
url (self-explanatory)
recipient (the object who will see [url] in its browser)
browse_options (see the ref entry for browse())
*/

proc/browse_link(url,recipient,browse_options)
recipient << browse(\
"<html><head></head><body onLoad=\"parent.location='[url]'\"></body></html>"\
,browse_options)




///*
//Testing Code/Sample Implementation:

client/verb/test_browse_link()
//everybody will have google.com in their browser
browse_link("http://google.com",world)
//*/