Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function startPostMessageListener() {
postRobot.CONFIG.LOG_LEVEL = "error";
postRobot.on("bcup-close-dialog", () => {
hideInputDialog();
hideSaveDialog();
});
postRobot.on("bcup-get-url", () => window.location.href);
postRobot.on("bcup-open-url", event => {
const { url } = event.data;
chrome.runtime.sendMessage({ type: "open-tab", url });
});
}
import postRobot from "post-robot";
postRobot.CONFIG.LOG_LEVEL = "error";
export function closeDialog() {
return postRobot.send(window.top, "bcup-close-dialog");
}
export function getTopURL() {
return postRobot.send(window.top, "bcup-get-url").then(response => {
return response.data;
});
}
export function openURL(url) {
return postRobot.send(window.top, "bcup-open-url", { url });
}