Bug 766616. Don't try to inject mozSocial in about pages. r=jaws
authorFelipe Gomes <felipc@gmail.com>
Fri, 05 Oct 2012 17:22:09 -0700
changeset 115807 04870d2657db8115444cfa7293b6f803e4c8e639
parent 115806 61e6d94f821650ebb183bc4127bf8453d17dfa7b
child 115808 c9e91088418a2de397e458e63e71fff4e7887bbd
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs766616
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 766616. Don't try to inject mozSocial in about pages. r=jaws
toolkit/components/social/MozSocialAPI.jsm
--- a/toolkit/components/social/MozSocialAPI.jsm
+++ b/toolkit/components/social/MozSocialAPI.jsm
@@ -38,16 +38,21 @@ var MozSocialAPI = {
 // Called on document-element-inserted, checks that the API should be injected,
 // and then calls attachToWindow as appropriate
 function injectController(doc, topic, data) {
   try {
     let window = doc.defaultView;
     if (!window)
       return;
 
+    // Do not attempt to load the API into about: error pages
+    if (doc.documentURIObject.scheme == "about") {
+      return;
+    }
+
     var containingBrowser = window.QueryInterface(Ci.nsIInterfaceRequestor)
                                   .getInterface(Ci.nsIWebNavigation)
                                   .QueryInterface(Ci.nsIDocShell)
                                   .chromeEventHandler;
 
     let origin = containingBrowser.getAttribute("origin");
     if (!origin) {
       return;