• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<meta charset="utf-8">
3<title>Incumbent page used as a test helper</title>
4
5<script src="/wasm/jsapi/wasm-module-builder.js"></script>
6<script src="/wasm/jsapi/functions/helper.js"></script>
7
8<iframe src="relevant/relevant.html" id="r"></iframe>
9<iframe src="current/current.html" id="c"></iframe>
10
11<script>
12const relevant = document.querySelector("#r");
13const current = document.querySelector("#c");
14
15window.runWindowPostMessageVeryIndirectly = (...args) => {
16  return current.contentWindow.postMessage.call(relevant.contentWindow, ...args);
17};
18
19// This tests the backup incumbent settings object stack scenario, by avoiding putting user code on the stack.
20window.runWindowPostMessageVeryIndirectlyWithNoUserCode = (...args) => {
21  const runWindowPostMessage = current.contentWindow.postMessage.bind(relevant.contentWindow, ...args);
22  call_later(runWindowPostMessage);
23};
24</script>
25