Skip to content

Instantly share code, notes, and snippets.

@kennethkufluk
kennethkufluk / gist:5603204
Created May 18, 2013 04:10
Example of pushState breaking Safari 6.0.4. Run this anywhere. Click the page, see the url change to "page2". Use two fingers to swipe back. Wait five seconds, and the page will fade away, because the paint server dies.
<html>
<title>Bug in Safari 6.0.4</title>
<body>
Run this anywhere. Click the page, see the url change to "page2".<br/>
Use two fingers to swipe back. Wait five seconds, and the page will fade away, because the painter dies.<br/>
Does not fail if web inspector is open.
<script>
document.body.onclick = function() {
history.pushState({}, 'title', 'page2');
};
(function() {
if (window.__twitterIntentHandler) return;
var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
width = 550,
height = 420,
winHeight = screen.height,
winWidth = screen.width;
function handleIntent(e) {
@kennethkufluk
kennethkufluk / twitter-no-details.user.js
Created March 21, 2011 01:41
Hides the details pane from NewTwitter (Chrome)
// ==UserScript==
// @name Twitter No Details
// @description Removes the details pane from NewTwitter
// @version 1.0
// @author KennethKufluk
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==
@kennethkufluk
kennethkufluk / ou-frameset-quickfix.user.js
Created February 12, 2011 21:25
Fix for OU sites that wrongly load empty frames with src="#", breaking frameset navigation in modern browsers.
// ==UserScript==
// @match http://students.open.ac.uk/*
// ==/UserScript==
if (top==window) {
var myframes = document.getElementsByTagName('frame');
for (var frame in myframes) {
if (!myframes.hasOwnProperty(frame) || typeof myframes[frame] == 'undefined' ) continue;
if (myframes[frame].src.match(/\/#$/)) myframes[frame].src="about:blank";
}
}
@kennethkufluk
kennethkufluk / twitter-favicon.user.js
Created November 29, 2010 03:05
Dynamic Twitter Favicon
// ==UserScript==
// @name Twitter Dynamic Icon
// @description Changes the number on the Twitter favicon to reflect the current date, as per http://remysharp.com/2010/08/24/dynamic-favicons and http://userscripts.org/scripts/show/84382
// @version 1.0
// @author KennethKufluk
// @namespace ttp://kenneth.kufluk.com/blog/2010/11/dynamic-twitter-icon-with-greasemonkey-script-in-chrome/
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==
__defineGetter__("required", function() { throw new Error('Missing parameter'); })
function foo(mustBeProvided = required) {
return mustBeProvided;
}
> foo()
Error: Missing parameter
> foo(123)
123