How to use the post-robot.CONFIG function in post-robot

To help you get started, we’ve selected a few post-robot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buttercup / buttercup-browser-extension / source / tab / messaging.js View on Github external
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 });
    });
}
github buttercup / buttercup-browser-extension / source / dialog / library / context.js View on Github external
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 });
}