commit
753c794f04
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Cookie Dialog Monster",
|
"name": "Cookie Dialog Monster",
|
||||||
"version": "5.2.1",
|
"version": "5.3.0",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_appDesc__",
|
"description": "__MSG_appDesc__",
|
||||||
"icons": {
|
"icons": {
|
||||||
@ -27,6 +27,12 @@
|
|||||||
"run_at": "document_start"
|
"run_at": "document_start"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"permissions": ["http://*/*", "https://*/*", "storage", "tabs"],
|
"permissions": [
|
||||||
|
"contextMenus",
|
||||||
|
"http://*/*",
|
||||||
|
"https://*/*",
|
||||||
|
"storage",
|
||||||
|
"tabs"
|
||||||
|
],
|
||||||
"web_accessible_resources": ["assets/fonts/*", "scripts/*", "styles/*"]
|
"web_accessible_resources": ["assets/fonts/*", "scripts/*", "styles/*"]
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @description Context menu identifier
|
||||||
|
*/
|
||||||
|
|
||||||
|
const contextMenuId = "CDM_MENU";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Cache initial state
|
* @description Cache initial state
|
||||||
* @type {{ enabled: boolean }}
|
* @type {{ enabled: boolean }}
|
||||||
@ -214,6 +220,36 @@ chrome.runtime.onMessage.addListener((request, sender, callback) => {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description Creates context menu
|
||||||
|
*/
|
||||||
|
|
||||||
|
chrome.contextMenus.create({
|
||||||
|
contexts: ["all"],
|
||||||
|
id: contextMenuId,
|
||||||
|
title: "Report site...",
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description Listens to context menus
|
||||||
|
*/
|
||||||
|
|
||||||
|
chrome.contextMenus.onClicked.addListener((info, tab) => {
|
||||||
|
if (info.menuItemId !== contextMenuId) return;
|
||||||
|
|
||||||
|
fetch("https://cdm-report-service.herokuapp.com/rest/v1/report/", {
|
||||||
|
body: JSON.stringify({
|
||||||
|
text: tab.url,
|
||||||
|
to: "wanhose.development@gmail.com",
|
||||||
|
subject: "Cookie Dialog Monster Report",
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-type": "application/json",
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Listens to updates
|
* @description Listens to updates
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user