[Pkg-mozext-commits] [greasemonkey] 21/35: Merge remote-tracking branch 'crazycatz00/palemoon'

David Prévot taffit at moszumanska.debian.org
Wed May 20 02:43:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 2bfab50979f9d281a012e4c8fb03371c42dd7c2a
Merge: 05372a0 9361136
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Wed May 6 16:04:53 2015 -0400

    Merge remote-tracking branch 'crazycatz00/palemoon'
    
    Fixes #2038

 content/scratchpad-overlay.js |  9 ++++++++-
 install.rdf                   |  9 +++++++++
 modules/xmlhttprequester.js   | 13 ++++++++++---
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --cc modules/xmlhttprequester.js
index 9abff6c,f42ab8b..e39550f
--- a/modules/xmlhttprequester.js
+++ b/modules/xmlhttprequester.js
@@@ -12,8 -5,10 +12,12 @@@ var gStringBundle = Component
  function GM_xmlhttpRequester(wrappedContentWin, originUrl, sandbox) {
    this.wrappedContentWin = wrappedContentWin;
    this.originUrl = originUrl;
 -  // Firefox < 29 does not support getObjectPrincipal in a scriptable context.
 -  // Older Greasemonkey didn't use this, so if the browser doesn't support it,
 -  // this shouldn't be less secure (for that browser).
 -  this.sandboxPrincipal = 'function' == typeof Components.utils.getObjectPrincipal ? Components.utils.getObjectPrincipal(sandbox) : null;
 +  this.sandbox = sandbox;
-   this.sandboxPrincipal = Components.utils.getObjectPrincipal(sandbox);
++  // Firefox < 29 (i.e. PaleMoon) does not support getObjectPrincipal in a 
++  // scriptable context.  Greasemonkey users on this platform otherwise would
++  // use an older version without this check, so skipping is no worse.
++  this.sandboxPrincipal = 'function' == typeof Components.utils.getObjectPrincipal
++      ? Components.utils.getObjectPrincipal(sandbox) : null;
  }
  
  // this function gets called by user scripts in content security scope to
@@@ -207,10 -172,13 +211,13 @@@ function(wrappedContentWin, sandbox, re
    var eventCallback = details["on" + event];
    if (!eventCallback) return;
  
 -  // Firefox < 29 hack; see above.
 +  // ... but ensure that the callback came from a script, not content, by
 +  // checking that its principal equals that of the sandbox.
-   var callbackPrincipal = Components.utils.getObjectPrincipal(eventCallback);
-   if (!this.sandboxPrincipal.equals(callbackPrincipal)) return;
+   if ('function' == typeof Components.utils.getObjectPrincipal) {
 -    // ... but ensure that the callback came from a script, not content, by
 -    // checking that its principal equals that of the sandbox.
++    // Firefox < 29; i.e. PaleMoon.
+     var callbackPrincipal = Components.utils.getObjectPrincipal(eventCallback);
+     if (!this.sandboxPrincipal.equals(callbackPrincipal)) return;
+   }
  
    req.addEventListener(event, function(evt) {
      var responseState = {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list