summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html')
-rw-r--r--testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html b/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html
new file mode 100644
index 0000000000..dcb9302d8d
--- /dev/null
+++ b/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html
@@ -0,0 +1,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>