port opengl demo to new chromeless events

This commit is contained in:
Lloyd Hilaiel 2011-02-11 11:23:05 -07:00
Родитель 05cf28031c
Коммит 76c9035dc4
1 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -45,14 +45,11 @@ var gThumbImageRef = null; // This is being used by webgl-demo.js
function launchBrowser() { function launchBrowser() {
myBrowser = document.createElement("iframe"); myBrowser = document.createElement("iframe");
require("iframe-as-browser").bind(myBrowser,document); myBrowser.addEventListener("ChromelessLoadStop", function (e) {
myBrowser.addEventListener("experimental-dom-progress", function (e) {
if(e.percentage>=100) {
thumbnailUpdate(); thumbnailUpdate();
}
},false); },false);
document.body.appendChild(myBrowser); document.body.appendChild(myBrowser);
myBrowser.src = "http://www.google.com/"; myBrowser.src = "http://mozillalabs.com/chromeless";
} }
function thumbnailUpdate() { function thumbnailUpdate() {
@ -70,7 +67,7 @@ function thumbnailUpdate() {
//document.body.appendChild(gThumbImageRef); //document.body.appendChild(gThumbImageRef);
} }
/* We do this because we need a 64x64 picture even to make a /* We do this because we need a 64x64 picture even to make a
texture, required by the webgl demo */ * texture, required by the webgl demo */
var square = document.createElement("canvas"); var square = document.createElement("canvas");
ctx = square.getContext("2d"); ctx = square.getContext("2d");