1 | <!doctype html>
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | <html lang="en">
|
12 | <head>
|
13 | <title>url-bar demo</title>
|
14 | <meta charset="utf-8">
|
15 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
16 | <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
17 |
|
18 | <script src="https://unpkg.com/@webcomponents/webcomponentsjs@^2.0.0/webcomponents-loader.js"></script>
|
19 |
|
20 | <script type="module">
|
21 | import '../demo-pages-shared-styles.js';
|
22 |
|
23 | import {html} from '@polymer/polymer/lib/utils/html-tag.js';
|
24 |
|
25 | const template = html`
|
26 | <custom-style>
|
27 | <style is="custom-style" include="demo-pages-shared-styles">
|
28 | iframe {
|
29 | width: 100%;
|
30 | }
|
31 | </style>
|
32 | </custom-style>
|
33 | `;
|
34 | document.body.appendChild(template.content);
|
35 | </script>
|
36 | </head>
|
37 | <body unresolved>
|
38 | <url-bar></url-bar>
|
39 | <div id="message"></div>
|
40 |
|
41 | <script type="module">
|
42 | import '../url-bar.js';
|
43 | var message;
|
44 | if (window.top !== window) {
|
45 | message = 'URL Bar should appear above this text';
|
46 | } else {
|
47 | message = 'No URL Bar above this text. iframe below this text with URL bar.';
|
48 | var iframe = document.createElement('iframe');
|
49 | iframe.setAttribute('src', window.location.href);
|
50 | document.body.appendChild(iframe);
|
51 | }
|
52 | document.querySelector('#message').innerText = message;
|
53 | </script>
|
54 | </body>
|
55 | </html>
|