Bug 804411 Feed previews should still work when JavaScript is disabled r=IanN a=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 31 Oct 2012 20:16:42 +0000
changeset 13529 2ccb24c2d876f08ef45388dde4f656bd9a4f9d1b
parent 13528 cb6d8a94c6101d5dc5f11c641fc923a22ad02114
child 13530 896eaa8b2eac564205f6668b96e5fa55ba1ec476
push idunknown
push userunknown
push dateunknown
reviewersIanN, IanN
bugs804411
Bug 804411 Feed previews should still work when JavaScript is disabled r=IanN a=IanN
suite/feeds/src/FeedConverter.js
--- a/suite/feeds/src/FeedConverter.js
+++ b/suite/feeds/src/FeedConverter.js
@@ -1,13 +1,14 @@
 /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/debug.js");
 
 const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
 const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed";
 const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed";
 const TYPE_ANY = "*/*";
 
@@ -253,16 +254,18 @@ FeedConverter.prototype = {
 
         // Store the result in the result service so that the display
         // page can access it.
         feedService.addFeedResult(result);
 
         // Now load the actual XUL document.
         var chromeURI = this._ioSvc.newURI(FEEDHANDLER_URI, null, null);
         chromeChannel = this._ioSvc.newChannelFromURI(chromeURI, null);
+        chromeChannel.owner = Services.scriptSecurityManager
+                                      .getNoAppCodebasePrincipal(chromeURI);
         chromeChannel.originalURI = result.uri;
       }
       else
         chromeChannel = this._ioSvc.newChannelFromURI(result.uri, null);
 
       chromeChannel.loadGroup = this._request.loadGroup;
       chromeChannel.asyncOpen(this._listener, null);
     }