Skip to content

Instantly share code, notes, and snippets.

@trevorlinton
Created July 9, 2014 05:22
Show Gist options
  • Save trevorlinton/7effc61d7ca0c99b4cb7 to your computer and use it in GitHub Desktop.
Save trevorlinton/7effc61d7ca0c99b4cb7 to your computer and use it in GitHub Desktop.
Tint2 Web Browser Example
application.addEventListener('launch', function() {
var win = new Window(800,600);
win.title = "My web browser, probably should add a status bar...";
var web = new WebView(win);
web.addEventListener('load', function() {
console.log('We may load this, unsure yet, nothing has been received but the request for: '+web.location);
});
web.addEventListener('request', function() {
console.log('Weve received a request and may go parse it out, last chance to cancel.');
});
web.addEventListener('locationchange', function() {
console.log('The webviews location changed!');
});
web.addEventListener('loading', function() {
console.log('We received the request and are beginning to parse it.');
});
web.location = 'http://www.trueinteractions.com';
win.appendChild(web);
});
application.addEventListener('unload', function() {
console.log('leaving..');
});
application.launch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment