Add setSmartCellEditorIntellisenseNode to iframe (#2230)

This commit is contained in:
Cristine Guadelupe 2023-09-26 21:54:03 +07:00 committed by GitHub
parent b3f7366a8f
commit 1c92311f8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -26,7 +26,7 @@ import { sha256Base64 } from "../../lib/utils";
// (2): https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
// (3): https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
const IFRAME_SHA256 = "48LZtKkFYMd+4gsmVvbhvw9mTpJPw+ItRdGxPPs+5xw=";
const IFRAME_SHA256 = "wcqj5QWCo66osdAWDnEgPRFyL7nfe8oNqNggnw4vvW8=";
export function initializeIframeSource(iframe, iframePort, iframeUrl) {
const url = getIframeUrl(iframePort, iframeUrl);

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<base target="_parent">
<base target="_parent" />
<title>Output</title>
<style>
html,
@ -102,6 +102,14 @@
state.secretHandler = callback;
postMessage({ type: "selectSecret", preselectName, options });
},
setSmartCellEditorIntellisenseNode(node, cookie) {
postMessage({
type: "setSmartCellEditorIntellisenseNode",
node,
cookie,
});
},
};
window.addEventListener("message", (event) => {