youtube iframe embedding from non whitelisted not working

Bug reports and enhancement requests
Post Reply
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

youtube iframe embedding from non whitelisted not working

Post by al_9x »

http://apiblog.youtube.com/2010/07/new- ... ideos.html

Fx 3.6.12, NS 2.0.6rc2, new profile, forbid iframes, apply to trusted, allow (youtube.com, ytimg.com)

load the following as non whitelisted:

Code: Select all

<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/JW5meKfy3fY" frameborder="0"></iframe>
after activating the iframe, the embed placeholder should appear, it doesn't
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: youtube iframe embedding from non whitelisted not workin

Post by Giorgio Maone »

I suppose you forgot to mention noscript.forbidIFrameContext=2.
Either way, I can't reproduce on latest development build 2.0.8rc3.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: youtube iframe embedding from non whitelisted not workin

Post by al_9x »

Giorgio Maone wrote:I suppose you forgot to mention noscript.forbidIFrameContext=2.
no, it's at default
Giorgio Maone wrote:Either way, I can't reproduce on latest development build 2.0.8rc3.
  1. Start with a new profile (Fx 3.6.12, NS 2.0.8rc3)
  2. forbid iframe, apply to trusted
  3. allow youtube.com, ytimg.com
  4. load the following page locally (JS not allowed):

    Code: Select all

    <iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/JW5meKfy3fY" frameborder="0"></iframe>
    
  5. you'll get the iframe placeholder, activate it, the iframe loads
  6. now there should be a flash placeholder, it's not there
    as the iframe loads the following is logged:

    Code: Select all

    [NoScript] Content BLOCKED JavaScript/Data URL -- type: 7, location: javascript:window.__defineGetter__("top",%20(Window.prototype%20||%20window).__lookupGetter__("top")), origin: file:///C:/test.htm, ctx: <HTML Element>, mime: , null
    
    [NoScript] Content BLOCKED Content (Fatal Error, [Exception... "Component returned failure code: 0x805e000a [nsIDOMLocation.href]"  nsresult: "0x805e000a (<unknown>)"  location: "JS frame :: chrome://noscript/content/Policy.js :: anonymous :: line 572"  data: no] - undefined) -- type: 5, location: http://s.ytimg.com/yt/swf/watch_as3-vflofTU0v.swf, origin: http://www.youtube.com/embed/JW5meKfy3fY, ctx: <HTML Element>, mime: application/x-shockwave-flash, null
    
    Policy.js

    Code: Select all

          if (/\binnerHTML\b/.test(new Error().stack)) {
            if (this._bug453825) {
    572->     aContext.ownerDocument.location.href = 'javascript:window.__defineGetter__("top", (Window.prototype || window).__lookupGetter__("top"))';
              if (this.consoleDump) this.dump("Locked window.top (bug 453825 work-around)");
            }
            if (this._bug472495) {
              aContext.ownerDocument.defaultView.addEventListener("DOMNodeRemoved", this._domNodeRemoved, true);
              if (this.consoleDump) this.dump("Added DOMNodeRemoved (bug 472495 work-around)");
            }
          }
    
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: youtube iframe embedding from non whitelisted not workin

Post by Giorgio Maone »

Sorry, my fault. You said "as non whitelisted", but I assumed your proposed test page was the link you gave me, which was obviously whitelisted if youtube.com needed to be allowed.
This looks like some strange Firefox bug, though, which I can only work around.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: youtube iframe embedding from non whitelisted not workin

Post by Giorgio Maone »

Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: youtube iframe embedding from non whitelisted not workin

Post by al_9x »

Giorgio Maone wrote:Please check latest development build.
fixed
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Post Reply