diff options
Diffstat (limited to 'examples/qmlapp/index.html')
-rw-r--r-- | examples/qmlapp/index.html | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/examples/qmlapp/index.html b/examples/qmlapp/index.html index e062e83..40843a7 100644 --- a/examples/qmlapp/index.html +++ b/examples/qmlapp/index.html @@ -1,17 +1,7 @@ <html> <head> <script> - document.body.innerHTML = JSON.stringify(location); - function getWebChannelBaseUrl() { - var query = window.location.search.substring(1); - var vars = query.split("&"); - for (var i=0;i<vars.length;i++) { - var pair = vars[i].split("="); - if (pair[0] == "webChannelBaseUrl") - return pair[1]; - } - } - document.write('<script src="' + getWebChannelBaseUrl() + '"><' + '/script>'); + document.write('<script src="' + (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/]+)/.exec(location.search)[1]) + '"><' + '/script>'); function output(x) { document.querySelector("#out").innerHTML += x + "<br/>"; |