Whenever running alert(\'something\')
in JSFiddle, I get the error:
Ignored call to \'alert()\'. The document is sandboxed, and the \'all
IFrame sandboxing is a technique that helps protect from outside content creating confusing popups that would appear to come from the main website. To allow alert popups you will need to find the iframe tag, and modify the sandbox attribute to contain the allow-modals value. For JSFiddle this is the iframe named "result". You will need to Re-Run (ctrl-enter) your Fiddle after modifying the tag.
Using web browser Developer Tools or something like Grease Monkey/Tamper Monkey change the iframe.
From this:
To this:
The following TamperMonkey snippet seems to do the trick nicely:
// ==UserScript==
// @name Enable alert()s
// @match //jsfiddle.com/*
// @require http://code.jquery.com/jquery-latest.min.js
// @grant unsafeWindow
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
$("iframe[name='result']").each(function() {
this.sandbox += ' allow-modals';
});