Skip to content

Instantly share code, notes, and snippets.

@chebee7i
Forked from jerodsanto/gist:1137337
Created July 20, 2013 19:01
Show Gist options
  • Save chebee7i/6046088 to your computer and use it in GitHub Desktop.
Save chebee7i/6046088 to your computer and use it in GitHub Desktop.
(function() {
function uncrippleFrame() {
var body = this.contentWindow.document.getElementsByTagName('body')[0];
this.contentWindow.onclick = null;
body._frame = this;
body.onmousemove = function() {
this._frame.contentWindow.onclick = null;
this.setAttribute('style', '-webkit-user-select: auto;');
this.oncontextmenu = body.onselectstart = null;
};
body.onmousemove();
};
var container = document.getElementsByTagName('iframe')[0].contentWindow;
var frames = container.document.getElementsByTagName('iframe');
for (var i = 0; i < frames.length; i++) {
uncrippleFrame.call(frames[i]);
frames[i].onload = uncrippleFrame;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment