Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide whitespace changes
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Text styles
Change appearance
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
11 years ago
Diff never expires
Clear
Export
Share
Explain
47 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
143 lines
Copy
17 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
114 lines
Copy
/* This Source Code Form is subject to the terms of the Mozilla Public
/* This Source Code Form is subject to the terms of the Mozilla Public
Copy
Copied
Copy
Copied
* License, v. 2.0. If a copy of the MPL was not distributed with this
* License, v. 2.0. If a copy of the MPL was not distributed with this
file,
*
file,
You can obtain one at http://mozilla.org/MPL/2.0/. */
*
You can obtain one at http://mozilla.org/MPL/2.0/. */
const wpl = Components.interfaces.nsIWebProgressListener;
const wpl = Components.interfaces.nsIWebProgressListener;
var reporterListener = {
var reporterListener = {
_isBusy: false,
_isBusy: false,
Copy
Copied
Copy
Copied
get statusMeter() {
delete this.statusMeter;
return this.statusMeter = document.getElementById("statusbar-icon");
},
get securityButton() {
get securityButton() {
delete this.securityButton;
delete this.securityButton;
return this.securityButton = document.getElementById("security-button");
return this.securityButton = document.getElementById("security-button");
},
},
Copy
Copied
Copy
Copied
get securityLabel() {
delete this.securityLabel;
return this.securityLabel = document.getElementById("security-status");
},
get securityDisplay() {
delete this.securityDisplay;
return this.securityDisplay = document.getElementById("security-display");
},
QueryInterface: function(aIID) {
QueryInterface: function(aIID) {
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
aIID.equals(Components.interfaces.nsISupports))
return this;
return this;
throw Components.results.NS_NOINTERFACE;
throw Components.results.NS_NOINTERFACE;
},
},
Copy
Copied
Copy
Copied
onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in nsIRequest*/ aRequest,
/*in unsigned long*/ aStateFlags,
/*in unsigned long*/ aStateFlags,
/*in nsresult*/ aStatus) {
/*in nsresult*/ aStatus) {
Copy
Copied
Copy
Copied
if (aStateFlags & wpl.STATE_START &&
aStateFlags & wpl.STATE_IS_NETWORK) {
this.statusMeter.value = 0;
this.statusMeter.parentNode.collapsed = false;
this.securityLabel.collapsed = true;
}
else if (aStateFlags & wpl.STATE_STOP &&
aStateFlags & wpl.STATE_IS_NETWORK) {
this.statusMeter.parentNode.collapsed = true;
this.securityLabel.collapsed = false;
}
},
},
onProgressChange: function(/*in nsIWebProgress*/ aWebProgress,
onProgressChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in nsIRequest*/ aRequest,
/*in long*/ aCurSelfProgress,
/*in long*/ aCurSelfProgress,
/*in long */aMaxSelfProgress,
/*in long */aMaxSelfProgress,
/*in long */aCurTotalProgress,
/*in long */aCurTotalProgress,
/*in long */aMaxTotalProgress) {
/*in long */aMaxTotalProgress) {
Copy
Copied
Copy
Copied
if (aMaxTotalProgress > 0) {
let percentage = (aCurTotalProgress * 100) / aMaxTotalProgress;
this.statusMeter.value = percentage;
}
},
},
onLocationChange: function(/*in nsIWebProgress*/ aWebProgress,
onLocationChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in nsIRequest*/ aRequest,
/*in nsIURI*/ aLocation) {
/*in nsIURI*/ aLocation) {
Copy
Copied
Copy
Copied
this.securityDisplay.setAttribute('label',
aLocation.
host)
;
document.getElementById("headerMessage").textContent =
aLocation.
spec
;
},
},
onStatusChange: function(/*in nsIWebProgress*/ aWebProgress,
onStatusChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in nsIRequest*/ aRequest,
/*in nsresult*/ aStatus,
/*in nsresult*/ aStatus,
/*in wstring*/ aMessage) {
/*in wstring*/ aMessage) {
},
},
onSecurityChange: function(/*in nsIWebProgress*/ aWebProgress,
onSecurityChange: function(/*in nsIWebProgress*/ aWebProgress,
/*in nsIRequest*/ aRequest,
/*in nsIRequest*/ aRequest,
/*in unsigned long*/ aState) {
/*in unsigned long*/ aState) {
const wpl_security_bits = wpl.STATE_IS_SECURE |
const wpl_security_bits = wpl.STATE_IS_SECURE |
wpl.STATE_IS_BROKEN |
wpl.STATE_IS_BROKEN |
wpl.STATE_IS_INSECURE |
wpl.STATE_IS_INSECURE |
wpl.STATE_SECURE_HIGH |
wpl.STATE_SECURE_HIGH |
wpl.STATE_SECURE_MED |
wpl.STATE_SECURE_MED |
wpl.STATE_SECURE_LOW;
wpl.STATE_SECURE_LOW;
Copy
Copied
Copy
Copied
let
browser = document.getElementById("requestFrame");
var
browser = document.getElementById("requestFrame");
let
level;
var
level;
switch (aState & wpl_security_bits) {
switch (aState & wpl_security_bits) {
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_HIGH:
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_HIGH:
level = "high";
level = "high";
break;
break;
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_MED:
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_MED:
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_LOW:
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_LOW:
level = "low";
level = "low";
break;
break;
case wpl.STATE_IS_BROKEN:
case wpl.STATE_IS_BROKEN:
level = "broken";
level = "broken";
break;
break;
}
}
if (level) {
if (level) {
this.securityButton.setAttribute("level", level);
this.securityButton.setAttribute("level", level);
this.securityButton.hidden = false;
this.securityButton.hidden = false;
Copy
Copied
Copy
Copied
this.securityLabel.setAttribute("label", browser.securityUI.tooltipText);
} else {
} else {
this.securityButton.hidden = true;
this.securityButton.hidden = true;
this.securityButton.removeAttribute("level");
this.securityButton.removeAttribute("level");
}
}
this.securityButton.setAttribute("tooltiptext",
this.securityButton.setAttribute("tooltiptext",
browser.securityUI.tooltipText);
browser.securityUI.tooltipText);
}
}
}
}
function cancelRequest()
function cancelRequest()
{
{
reportUserClosed();
reportUserClosed();
window.close();
window.close();
}
}
function reportUserClosed()
function reportUserClosed()
{
{
Copy
Copied
Copy
Copied
let request = window.arguments[0]
;
let request = window.arguments[0]
.wrappedJSObject
;
request.QueryInterface(Components.interfaces.prplIRequestBrowser)
;
request.cancelled();
request.cancelled();
}
}
function loadRequestedUrl()
function loadRequestedUrl()
{
{
Copy
Copied
Copy
Copied
let request = window.arguments[0]
;
let request = window.arguments[0]
.wrappedJSObject
;
request.QueryInterface(Components.interfaces.prplIRequestBrowser)
;
document.getElementById("headerMessage").textContent = request.promptText;
document.getElementById("headerMessage").textContent = request.promptText;
let account = request.account;
let account = request.account;
Copy
Copied
Copy
Copied
document.getElementById("headerLabel").value =
if (request.iconURI != "")
account.protocol.name + " - " + account.name;
document.getElementById("headerImage").src =
request.
icon
URI
;
document.getElementById("headerImage").src =
account.protocol.
icon
Base
URI
+ "icon48.png"
;
Copy
Copied
Copy
Copied
let
browser = document.getElementById("requestFrame");
var
browser = document.getElementById("requestFrame");
browser.addProgressListener(reporterListener,
browser.addProgressListener(reporterListener,
Components.interfaces.nsIWebProgress.NOTIFY_ALL);
Components.interfaces.nsIWebProgress.NOTIFY_ALL);
Copy
Copied
Copy
Copied
let
url = request.url;
var
url = request.url;
if (url != "")
if (url != "")
{
browser.setAttribute("src", url);
browser.setAttribute("src", url);
Copy
Copied
Copy
Copied
document.getElementById("headerMessage").textContent = url;
}
request.loaded(window, browser.webProgress);
request.loaded(window, browser.webProgress);
}
}
Saved diffs
Original text
Open file
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const wpl = Components.interfaces.nsIWebProgressListener; var reporterListener = { _isBusy: false, get statusMeter() { delete this.statusMeter; return this.statusMeter = document.getElementById("statusbar-icon"); }, get securityButton() { delete this.securityButton; return this.securityButton = document.getElementById("security-button"); }, get securityLabel() { delete this.securityLabel; return this.securityLabel = document.getElementById("security-status"); }, get securityDisplay() { delete this.securityDisplay; return this.securityDisplay = document.getElementById("security-display"); }, QueryInterface: function(aIID) { if (aIID.equals(Components.interfaces.nsIWebProgressListener) || aIID.equals(Components.interfaces.nsISupportsWeakReference) || aIID.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; }, onStateChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in unsigned long*/ aStateFlags, /*in nsresult*/ aStatus) { if (aStateFlags & wpl.STATE_START && aStateFlags & wpl.STATE_IS_NETWORK) { this.statusMeter.value = 0; this.statusMeter.parentNode.collapsed = false; this.securityLabel.collapsed = true; } else if (aStateFlags & wpl.STATE_STOP && aStateFlags & wpl.STATE_IS_NETWORK) { this.statusMeter.parentNode.collapsed = true; this.securityLabel.collapsed = false; } }, onProgressChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in long*/ aCurSelfProgress, /*in long */aMaxSelfProgress, /*in long */aCurTotalProgress, /*in long */aMaxTotalProgress) { if (aMaxTotalProgress > 0) { let percentage = (aCurTotalProgress * 100) / aMaxTotalProgress; this.statusMeter.value = percentage; } }, onLocationChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in nsIURI*/ aLocation) { this.securityDisplay.setAttribute('label', aLocation.host); }, onStatusChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in nsresult*/ aStatus, /*in wstring*/ aMessage) { }, onSecurityChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in unsigned long*/ aState) { const wpl_security_bits = wpl.STATE_IS_SECURE | wpl.STATE_IS_BROKEN | wpl.STATE_IS_INSECURE | wpl.STATE_SECURE_HIGH | wpl.STATE_SECURE_MED | wpl.STATE_SECURE_LOW; let browser = document.getElementById("requestFrame"); let level; switch (aState & wpl_security_bits) { case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_HIGH: level = "high"; break; case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_MED: case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_LOW: level = "low"; break; case wpl.STATE_IS_BROKEN: level = "broken"; break; } if (level) { this.securityButton.setAttribute("level", level); this.securityButton.hidden = false; this.securityLabel.setAttribute("label", browser.securityUI.tooltipText); } else { this.securityButton.hidden = true; this.securityButton.removeAttribute("level"); } this.securityButton.setAttribute("tooltiptext", browser.securityUI.tooltipText); } } function cancelRequest() { reportUserClosed(); window.close(); } function reportUserClosed() { let request = window.arguments[0]; request.QueryInterface(Components.interfaces.prplIRequestBrowser); request.cancelled(); } function loadRequestedUrl() { let request = window.arguments[0]; request.QueryInterface(Components.interfaces.prplIRequestBrowser); document.getElementById("headerMessage").textContent = request.promptText; let account = request.account; document.getElementById("headerLabel").value = account.protocol.name + " - " + account.name; document.getElementById("headerImage").src = account.protocol.iconBaseURI + "icon48.png"; let browser = document.getElementById("requestFrame"); browser.addProgressListener(reporterListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL); let url = request.url; if (url != "") browser.setAttribute("src", url); request.loaded(window, browser.webProgress); }
Changed text
Open file
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ const wpl = Components.interfaces.nsIWebProgressListener; var reporterListener = { _isBusy: false, get securityButton() { delete this.securityButton; return this.securityButton = document.getElementById("security-button"); }, QueryInterface: function(aIID) { if (aIID.equals(Components.interfaces.nsIWebProgressListener) || aIID.equals(Components.interfaces.nsISupportsWeakReference) || aIID.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; }, onStateChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in unsigned long*/ aStateFlags, /*in nsresult*/ aStatus) { }, onProgressChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in long*/ aCurSelfProgress, /*in long */aMaxSelfProgress, /*in long */aCurTotalProgress, /*in long */aMaxTotalProgress) { }, onLocationChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in nsIURI*/ aLocation) { document.getElementById("headerMessage").textContent = aLocation.spec; }, onStatusChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in nsresult*/ aStatus, /*in wstring*/ aMessage) { }, onSecurityChange: function(/*in nsIWebProgress*/ aWebProgress, /*in nsIRequest*/ aRequest, /*in unsigned long*/ aState) { const wpl_security_bits = wpl.STATE_IS_SECURE | wpl.STATE_IS_BROKEN | wpl.STATE_IS_INSECURE | wpl.STATE_SECURE_HIGH | wpl.STATE_SECURE_MED | wpl.STATE_SECURE_LOW; var browser = document.getElementById("requestFrame"); var level; switch (aState & wpl_security_bits) { case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_HIGH: level = "high"; break; case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_MED: case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_LOW: level = "low"; break; case wpl.STATE_IS_BROKEN: level = "broken"; break; } if (level) { this.securityButton.setAttribute("level", level); this.securityButton.hidden = false; } else { this.securityButton.hidden = true; this.securityButton.removeAttribute("level"); } this.securityButton.setAttribute("tooltiptext", browser.securityUI.tooltipText); } } function cancelRequest() { reportUserClosed(); window.close(); } function reportUserClosed() { let request = window.arguments[0].wrappedJSObject; request.cancelled(); } function loadRequestedUrl() { let request = window.arguments[0].wrappedJSObject; document.getElementById("headerMessage").textContent = request.promptText; let account = request.account; if (request.iconURI != "") document.getElementById("headerImage").src = request.iconURI; var browser = document.getElementById("requestFrame"); browser.addProgressListener(reporterListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL); var url = request.url; if (url != "") { browser.setAttribute("src", url); document.getElementById("headerMessage").textContent = url; } request.loaded(window, browser.webProgress); }
Find difference