Changeset 642
- Timestamp:
- 01/20/08 18:25:55 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.7/src/chrome/chromeFiles/content/browser.js
r435 r642 118 118 */ 119 119 GM_BrowserUI.contentLoad = function(e) { 120 var safeWin; 120 121 var unsafeWin; 121 122 var href; … … 126 127 } 127 128 128 unsafeWin = e.target.defaultView.wrappedJSObject; 129 href = e.target.location.href; 129 safeWin = e.target.defaultView; 130 unsafeWin = safeWin.wrappedJSObject; 131 href = safeWin.location.href; 130 132 131 133 if (GM_isGreasemonkeyable(href)) { … … 143 145 } 144 146 145 if (!href.match(/\.user\.js$/)) { 146 return; 147 } 148 149 var browser = this.tabBrowser.getBrowserForDocument(e.target); 147 // Show the greasemonkey install banner if we are navigating to a .user.js 148 // file in a top-level tab. 149 if (href.match(/\.user\.js$/) && safeWin == safeWin.top) { 150 var browser = this.tabBrowser.getBrowserForDocument(safeWin.document); 151 this.showInstallBanner(browser); 152 } 153 }; 154 155 156 /** 157 * Shows the install banner across the top of the tab that is displayed when 158 * a user selects "show script source" in the install dialog. 159 */ 160 GM_BrowserUI.showInstallBanner = function(browser) { 150 161 var greeting = this.bundle.getString("greeting.msg"); 151 162
