Chrome Extensions have had a Version 2 of their options page since Chrome 40. I tried creating an options V2 page with a button that just has a simple alert
:
js
function resetAll() {
alert("Not yet implemented.");
}
document.getElementById("reset-button").onclick = resetAll;
html
<button id="reset-button">Reset All</button>
When I click the button in the options page, nothing happens. I even pulled up the Javascript Debugger to see if my code was actually being run. And it was, but no alert showed up.
If I use Chrome Extension's older options page format, the alert shows up without problem.
Is there no way to create a browser-native alert
with OptionsV2?
Select Content Settings under Privacy.A box with a list of settings will appear. Enable or Disable JavaScript is the last option. Select "Enable".
The website detects that my extension is installed and updates the page accordingly. Is this possible? Yes, it is possible to detect extensions, so long as you know your extension ID (which I'm sure you do).
Or, in the menu bar, go to Window > Extensions. Or, right-click on any extension icon in your toolbar and choose Manage Extensions. The Extension page shows a list of all extensions you've installed for Chrome and whether they are enabled or disabled.
chrome.extension.getBackgroundPage().alert('Are you sure you want to delete X?');
chrome.extension.getBackgroundPage().confirm('Are you sure you want to delete X?')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With