Ticket #53: greasemonkey-songbird-patch.2.diff

File greasemonkey-songbird-patch.2.diff, 4.4 kB (added by i..@mckellar.org, 2 years ago)

Make greasemonkey work in songbird

  • trunk/src/chrome.manifest

    old new  
    11content    greasemonkey    chrome/chromeFiles/content/ 
    22overlay    chrome://browser/content/browser.xul    chrome://greasemonkey/content/browser.xul 
     3overlay    chrome://songbird/content/xul/mainScriptsOverlay.xul    chrome://greasemonkey/content/browser.xul 
    34locale  greasemonkey  en-US  chrome/chromeFiles/locale/en-US/ 
  • trunk/src/chrome/chromeFiles/content/browser.js

    old new  
    1111GM_BrowserUI.QueryInterface = function(aIID) { 
    1212  if (!aIID.equals(Components.interfaces.nsISupports) && 
    1313      !aIID.equals(Components.interfaces.gmIBrowserWindow) && 
    14       !aIID.equals(Components.interfaces.nsISupportsWeakReference)) 
     14      !aIID.equals(Components.interfaces.nsISupportsWeakReference) && 
     15      !aIID.equals(Components.interfaces.nsIWebProgressListener)) 
    1516    throw Components.results.NS_ERROR_NO_INTERFACE; 
    1617 
    1718  return this; 
     
    5556    this.toolsMenu = document.getElementById("taskPopup"); 
    5657  } 
    5758 
     59  // songbird compat 
     60  if (!this.appContent && this.tabBrowser) { 
     61    this.appContent = this.tabBrowser.parentNode; 
     62  } 
     63 
    5864  // update visual status when enabled state changes 
    5965  this.enabledWatcher = GM_hitch(this, "refreshStatus"); 
    6066  GM_prefRoot.watch("enabled", this.enabledWatcher); 
     
    7480                          .getService(Components.interfaces.nsIWindowWatcher); 
    7581 
    7682  // this gives us onLocationChange 
    77   document.getElementById("content").addProgressListener(this, 
     83  this.tabBrowser.addProgressListener(this, 
    7884    Components.interfaces.nsIWebProgress.NOTIFY_LOCATION); 
    7985 
    8086  // update enabled icon 
     
    107113 */ 
    108114GM_BrowserUI.openInTab = function(domWindow, url) { 
    109115  if (this.isMyWindow(domWindow)) { 
    110     document.getElementById("content").addTab(url); 
     116    this.tabBrowser.addTab(url); 
    111117  } 
    112118} 
    113119 
  • trunk/src/chrome/chromeFiles/content/browser.xul

    old new  
    6262        <statusbarpanel id="gm-status" insertafter="livemark-button"> 
    6363            <label id="gm-status-label" collapsed="true" crop="end" style="width:0px; margin:0;" /> 
    6464            <image id="gm-status-image" width="16" height="16" style="margin:0 5px" 
     65              mousethrough="never" 
    6566              onclick="if (!event.button) GM_setEnabled(!GM_getEnabled()); 
    6667                       else if (event.button == 1) GM_BrowserUI.manageMenuItemClicked();" 
    6768              context='gm-status-popup'/> 
  • trunk/src/install.rdf

    old new  
    77 
    88    <em:name>Greasemonkey</em:name> 
    99    <em:id>{e4a8a97b-f2ed-450b-b12d-ee082ba24781}</em:id> 
    10     <em:version>0.7.20070607.0</em:version> 
     10    <em:version>0.7.20071101.0</em:version> 
    1111    <em:description>A User Script Manager for Firefox</em:description> 
    1212    <em:creator>Aaron Boodman; http://youngpup.net/</em:creator> 
    1313    <em:contributor>Anthony Lieuallen; http://arantius.com</em:contributor> 
     
    3030    <em:optionsURL>chrome://greasemonkey/content/manage.xul</em:optionsURL> 
    3131    <em:iconURL>chrome://greasemonkey/content/status_on.gif</em:iconURL> 
    3232 
     33    <!-- Firefox --> 
    3334    <em:targetApplication> 
    3435      <Description> 
    3536        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> 
     
    3839      </Description> 
    3940    </em:targetApplication> 
    4041 
     42    <!-- Songbird -->  
     43    <em:targetApplication> 
     44      <Description> 
     45        <em:id>songbird@songbirdnest.com</em:id> 
     46        <em:minVersion>0.3pre</em:minVersion> 
     47        <em:maxVersion>0.3.*</em:maxVersion> 
     48      </Description> 
     49    </em:targetApplication> 
     50 
    4151    <em:file> 
    4252      <Description about="urn:mozilla:extension:file:greasemonkey"> 
    4353        <em:package>content/</em:package>