Now that flash disabled by default in Chrome 75 our clients is having problems viewing our legacy content which was created using flash. I have referred to this SO question which had a couple of useful answers but for ease-of-use purposes, I'm leaning towards creating an extension that enables flash when a certain URL is accessed.
Chrome extension to enable flash plugin
manifest.json
{
"name": "Flash Enabler",
"version": "1.0",
"description": "Enable flash for Chrome",
"permissions": [
"contentSettings"
],
"content_scripts": [
{
"matches": [
"https://qa3.icomproductions.ca/*"
],
"js": [
"content_script.js"
]
}
],
"page_action": {
"default_icon": {
"16": "images/ice16.png",
"32": "images/ice32.png",
"48": "images/ice48.png",
"128": "images/ice128.png"
}
},
"icons": {
"16": "images/ice16.png",
"32": "images/ice32.png",
"48": "images/ice48.png",
"128": "images/ice128.png"
},
"manifest_version": 2
}
Here's a code based on that OP's snippet:
content_script.js
let flashIdentifier;
chrome.contentSettings.plugins.getResourceIdentifiers(indentifierArray => {
indentifierArray.forEach(indentifier => {
indentifier.id === 'adobe-flash-player' ? flashIdentifier = indentifierArray : flashIdentifier = null;
});
});
chrome.contentSettings.plugins.set({ 'primaryPattern': 'https://qa3.icomproductions.ca/*', 'resourceIdentifier': flashIdentifier, 'setting': 'allow' });
console.log(flashIdentifier);
This generates an error saying:
Any help would be appreciated!