Removing warnings reported by cppcheck tool.
[framework/web/wrt-installer.git] / tests / general / widgets / protocol_listener2 / index.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
5   <title>Custom handlers</title>
6 </head>
7 <body style="background-color:red;">
8     <h1 id="test">FAIL</h1>
9     <script type="text/javascript" src="hook.js"></script>
10     <script type="text/javascript">
11     try {
12         navigator.registerProtocolHandler("news", "news.html?uri=%s", "Example news");
13         if (navigator.isProtocolHandlerRegistered("news", "news.html?uri=%s") === 'registered') {
14             document.getElementById('test').innerHTML = 'PASSED';
15             document.body.style.backgroundColor = 'green';
16             hook(id, 'pass', 'protocol handler registered');
17         } else {
18             hook(id, 'fail', 'protocol handler not registered');
19         }
20     } catch (e) {
21         hook(id, 'fail', 'widget failed because ' + e.message);
22     }
23 </script>
24 </body>
25 </html>