const gettingCookies = browser.cookies.getAll();
gettingCookies.then(onGot, onError);runtime.lastError / notebook
runtime.lastError
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
function logCookie(c) {
if (browser.runtime.lastError) {
console.error(browser.runtime.lastError);
} else {
console.log(c);
}
}
browser.cookies.set({ url: "https://developer.mozilla.org/" }, logCookie);function logCookie(c) {
console.log(c);
}
function logError(e) {
console.error(e);
}
const setCookie = browser.cookies.set({
url: "https://developer.mozilla.org/",
});
setCookie.then(logCookie, logError);