Skip to content

Instantly share code, notes, and snippets.

@XP1
Created January 31, 2012 21:06
Show Gist options
  • Save XP1/1712912 to your computer and use it in GitHub Desktop.
Save XP1/1712912 to your computer and use it in GitHub Desktop.
Fix MSNBC: Fixes MSNBC's Adobe Flash detection by fixing the `UberSniff` function and by browser spoofing.
// ==UserScript==
// @name Fix MSNBC
// @version 1.01
// @description Fixes MSNBC's Adobe Flash detection by fixing the `UberSniff` function and by browser spoofing.
// @author XP1 (https://github.com/XP1/)
// @namespace https://gist.github.com/1712912/
// @include http*://msnbc.msn.com/*
// @include http*://*.msnbc.msn.com/*
// ==/UserScript==
/*jslint browser: true, vars: true, white: true, maxerr: 50, indent: 4 */
(function (window)
{
"use strict";
function removeEventListenerAfterFiring(numberOfTimes, callback)
{
var remaining = numberOfTimes;
return function listener(event)
{
remaining -= 1;
if (remaining <= 0)
{
var target = event.target;
var type = event.type;
target.removeEventListener(type, listener, false);
target.removeEventListener(type, listener, true);
}
callback();
};
}
function enhanceUberSniff()
{
window.UberSniff.prototype.opera = true;
}
function spoofBrowser()
{
window.navigator.userAgent += " Mozilla/5.0 Firefox";
}
function initialize()
{
enhanceUberSniff();
spoofBrowser();
}
window.addEventListener("DOMContentLoaded", removeEventListenerAfterFiring(1, initialize), false);
}(this));
@XP1
Copy link
Author

XP1 commented Jan 31, 2012

I posted this user JS in these threads:

Why does this site insist I don't have Flash when using Opera?:
http://my.opera.com/community/forums/topic.dml?id=1045672

Resolving MSNBC Site Quirks...:
http://my.opera.com/community/forums/topic.dml?id=1288942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment