summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html
blob: dcb9302d8d2dd22097e780aa91f8976c65d0d9c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/speculation-rules/prerender/resources/utils.js"></script>
<script>
const params = new URLSearchParams(location.search);
const uid = params.get('uid');

const bc = new PrerenderChannel('prerender-channel', uid);
assert_true(document.prerendering);

const plugins = new Array();
for (let i = 0; i < navigator.plugins.length; ++i) {
  const plugin = navigator.plugins[i];
  const types = Array.from(plugin, x => x.type);
  plugins[i] = {pluginLength: plugin.length, pluginTypes: types};
}
bc.postMessage(JSON.stringify(plugins));
bc.close();
</script>