Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
Adds a blacklist for well-known websites where shumway does not work yet
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed Sep 30, 2013
1 parent 59d26f7 commit 569f618
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion extension/firefox/components/FlashStreamConverter.js
Expand Up @@ -39,6 +39,8 @@ Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/NetUtil.jsm');

XPCOMUtils.defineLazyModuleGetter(this, 'PrivateBrowsingUtils',
'resource://gre/modules/PrivateBrowsingUtils.jsm');

let appInfo = Cc['@mozilla.org/xre/app-info;1'].getService(Ci.nsIXULAppInfo);
let Svc = {};
Expand Down Expand Up @@ -160,6 +162,28 @@ function fetchPolicyFile(url, cache, callback) {
xhr.send(null);
}

function isShumwayEnabledFor(actions) {
// disabled for PrivateBrowsing windows
if (PrivateBrowsingUtils.isWindowPrivate(actions.window)) {
return false;
}
// disabled if embed tag specifies shumwaymode (for testing purpose)
if (actions.objectParams['shumwaymode'] === 'off') {
return false;
}

var url = actions.url;
var baseUrl = actions.baseUrl;

// blacklisting well known sites with issues
if (/\.ytimg\.com\//i.test(url) /* youtube movies */ ||
/\/vui.swf\b/i.test(url) /* vidyo manager */ ) {
return false;
}

return true;
}

// All the priviledged actions.
function ChromeActions(url, window, document) {
this.url = url;
Expand Down Expand Up @@ -790,7 +814,7 @@ FlashStreamConverterBase.prototype = {
let actions = converter.createChromeActions(domWindow,
domWindow.document,
converter.getUrlHint(originalURI));
if (actions.objectParams['shumwaymode'] === 'off') {
if (!isShumwayEnabledFor(actions)) {
actions.fallback();
return;
}
Expand Down

0 comments on commit 569f618

Please sign in to comment.