diff options
Diffstat (limited to 'browser/base/content/browser.js')
-rwxr-xr-x | browser/base/content/browser.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 7b05e1da7..5a54dcc58 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1055,8 +1055,10 @@ var gBrowserInit = { window.matchMedia("(-moz-windows-default-theme)").matches) { let windowFrameColor = new Color(...Cu.import("resource:///modules/Windows8WindowFrameColor.jsm", {}) .Windows8WindowFrameColor.get()); - // Default to black for foreground text. - if (!windowFrameColor.isContrastRatioAcceptable(new Color(0, 0, 0))) { + // Check if window frame color is dark. + if ((windowFrameColor.r * 2 + + windowFrameColor.g * 5 + + windowFrameColor.b) <= 128 * 8) { document.documentElement.setAttribute("darkwindowframe", "true"); } } @@ -5686,7 +5688,7 @@ function middleMousePaste(event) { function stripUnsafeProtocolOnPaste(pasteData) { // Don't allow pasting javascript URIs since we don't support // LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL for those. - return pasteData.replace(/^(?:\s*javascript:)+/i, ""); + return pasteData.replace(/\r?\n/g, "").replace(/^(?:\s*javascript:)+/i, ""); } // handleDroppedLink has the following 2 overloads: |