let downloadId = 13;
function onCanceled() {
console.log(`Canceled download`);
}
function onError(error) {
console.log(`Error: ${error}`);
}
let canceling = browser.downloads.cancel(downloadId);
canceling.then(onCanceled, onError);downloads.cancel() / notebook
downloads.cancel()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.