-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for #5: allow forcing Flash into windowed mode.
- Loading branch information
Showing
6 changed files
with
144 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@namespace url(http://www.w3.org/1999/xhtml); | ||
|
||
object[type="application/x-shockwave-flash"]:not(.flashgestures-forced-window), | ||
embed[type="application/x-shockwave-flash"]:not(.flashgestures-forced-window) | ||
{ | ||
-moz-binding: url("chrome://flashgestures/content/bindings.xml#forceWindowedFlashPlayer") !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<bindings xmlns="http://www.mozilla.org/xbl" | ||
xmlns:xbl="http://www.mozilla.org/xbl" | ||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> | ||
<binding id="forceWindowedFlashPlayer" bindToUntrustedContent="true"> | ||
<implementation> | ||
<constructor> | ||
<![CDATA[ | ||
let plugin = this; | ||
let wmode = plugin.getAttribute("wmode") || (function() { | ||
let params = plugin.querySelectorAll("param[name]"); | ||
for (let i = 0, l = params.length; i < l; i++) { | ||
let param = params[i]; | ||
if (param.getAttribute("name").toLowerCase() === "wmode") | ||
return param.getAttribute("value"); | ||
} | ||
return ""; | ||
})(); | ||
//console.log("[FlashGestures] Flash player detected, wmode = " + (wmode || "(default)")); | ||
wmode = wmode.toLowerCase(); | ||
let preferredWmode = "direct"; | ||
if (wmode === "opaque" || wmode === "transparent") { | ||
if (plugin.hasAttribute("wmode")) { | ||
plugin.setAttribute("wmode", preferredWmode); | ||
} else { | ||
let params = plugin.querySelectorAll("param[name]"); | ||
for (let i = 0, l = params.length; i < l; i++) { | ||
let param = params[i]; | ||
if (param.getAttribute("name").toLowerCase() === "wmode") { | ||
param.setAttribute("value", preferredWmode); | ||
break; | ||
} | ||
} | ||
} | ||
//console.log("[FlashGestures] Forced into wmode = " + preferredWmode); | ||
} | ||
// Self-"unbind"ing | ||
// This does not actually remove the binding, however. But it does allow other bindings | ||
// to be attached to plugin elements. See | ||
// https://ask.mozilla.org/question/297/apply-and-remove-xbl-binding-on-runtime/ | ||
// for details. | ||
plugin.classList.add("flashgestures-forced-window"); | ||
]]> | ||
</constructor> | ||
</implementation> | ||
</binding> | ||
</bindings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pref("extensions.flashgestures.enabled", true); | ||
pref("extensions.flashgestures.toggleButtonAdded", false); | ||
pref("extensions.flashgestures.forceWindowedFlashPlayer", false); |