I'm trying to create an extension that will prevent Chrome from downloading any files but I haven't been successful.
Here's my manifest
{"name": "Download Cancel",
"description": "Prevents Downloads",
"version": "0.1",
"background": {"scripts": ["background.js"], "persistent": false},
"permissions": ["downloads", "tabs", "http://*/*","https://*/*"],
"manifest_version": 2}
and background.js
chrome.downloads.onCreated.addListener(function(item) {
chrome.downloads.cancel(item.id);
alert("Downloading files is not permitted");
chrome.downloads.removeFile(item.id);
});
Can anyone offer some suggestions as to what I am doing wrong?