~justinmcp/unity-chromium-extension/13.10

« back to all changes in this revision

Viewing changes to tests/context-as-uid-in-js/background-page.html

  • Committer: Alexandre Abreu
  • Date: 2012-04-26 19:56:12 UTC
  • Revision ID: alexandre.abreu@canonical.com-20120426195612-oj7djq47ktfa01fi
A given context can be used from js as an UID (used for better context/window tracking)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html>
 
2
<html>
 
3
    <head>
 
4
 
 
5
    <title>Unity Webapps Extension Test Background Page</title>
 
6
    <embed type="application/x-unity-webapps-npapi" id="unityChromiumExtensionId"/>
 
7
    
 
8
<script>
 
9
 
 
10
var plugin = document.getElementById ('unityChromiumExtensionId');
 
11
if ( ! plugin) {
 
12
    console.log ('Could not bind to the scriptable NPAPI plugin');
 
13
}
 
14
else {
 
15
    var service = plugin.service_new ();
 
16
    console.log ("Service: " + service);
 
17
    
 
18
    var context = plugin.context_new_lazy (service, "test", "test.com", null);
 
19
    console.log ("Context: " + context);
 
20
}
 
21
 
 
22
</script>
 
23
    
 
24
    </head>
 
25
 
 
26
    <body>
 
27
    </body>
 
28
 
 
29
</html>