Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Commit

Permalink
[FIX] ClickToFlash could mistakenly replace non-Flash elements which …
Browse files Browse the repository at this point in the history
…use the <object> element
  • Loading branch information
mattball committed Jun 25, 2010
1 parent 790bfcb commit 55fe64a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ClickToFlash.safariextension/ClickToFlash.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ ClickToFlash.prototype.handleBeforeLoadEvent = function(event) {
if (element instanceof HTMLEmbedElement || element instanceof HTMLObjectElement) {
if (element.allowedToLoad)
return;

if (element instanceof HTMLObjectElement) {
var type = element.getAttribute("type");
if (!type) {
return;
}

if (!type.match("application/x-shockwave-flash") && !type.match("application/futuresplash")) {
return;
}
}

this.settings = safari.self.tab.canLoad(event, "getSettings");
this.settings["whitelist"] = this.settings["whitelist"].split(",");
Expand Down

0 comments on commit 55fe64a

Please sign in to comment.