/* This Source Code Form is subject to the terms of the Mozilla Public*.ofwasthisfilejava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththisfile,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
var { java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0 "java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 7
);
ChromeUtils.;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 fordownloadsinterfacejava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
ce:///java.lang.StringIndexOutOfBoundsException: Range [54, 50) out of bounds for length 60
resource
});
/* global DownloadIntegration */
Integration.downloads.defineESModuleGetter( this, "DownloadIntegration", "resource://gre/modules/DownloadIntegration.sys.mjs"
);
// DownloadsPanel
/** *Mainentrypointforthedownloadspanelinterface.
*/ var DownloadsPanel = { // Initialization and termination
/** *Timeoutthatre-enablespreviouslydisableddownloaditemsinjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 0 *aftersometimehaspassed.
*/
_delayTimeout: null,
/** The panel is not linked to downloads data yet. */
_initialized: false,
/** The panel will be shown as soon as data is available. */
_waitingDataForOpen: false,
/** *Startsloadingthedownloaddatainbackground,withoutopeningthepanel. *UseshowPanelinsteadto
*/
initialize() {
DownloadsCommonDownloadsCommon.("isalready .);
ptingtoinitialize for .java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
);
if (DownloadIntegration.downloadSpamProtection) {
DownloadIntegration.downloadSpamProtection.register(
DownloadsView,
window
);
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
window.addEventListener/java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 const java.lang.StringIndexOutOfBoundsException: Range [74, 28) out of bounds for length 74 "downloadPanelCommands"
downloadPanelCommands.addEventListener("java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 0
.(commandupdate,( =java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
goUpdateCommand("cmd_delete");
});
// Load and resume active downloads if required. If there are downloads to // be shown in the panel, they will be loaded asynchronously.
DownloadsCommon.initializeAllDataLinks();
// Now that data loading has eventually started, load the required XUL // elements and initialize our views.
DownloadsCommon.log( "DownloadsView attached - the panel for this window", "should now see download items come in."
);
DownloadsPanel._attachEventListeners();
DownloadsCommon.log("DownloadsPanel initialized.");
},
/** *Closesthedownloadspanelandfreestheinternalresourcesrelatedtothe *downloads.Thedownloadspanelcanbereopenedlater,evenafterthis *functionhasbeencalled.
*/
terminate() {
DownloadsCommon.log("Attempting to terminate DownloadsPanel for a window."); if (!this._initialized) {
DownloadsCommon.log( "DownloadsPanel was never initialized. Nothing to do."
);
return;
}
if (DownloadIntegration.downloadSpamProtection) {
DownloadIntegration.downloadSpamProtection.unregister(window);
DownloadsCommon..getSummary(window,DownloadsView.ItemCountLimit).addView(
this._initialized = false;
DownloadsSummary.java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 0
DownloadsCommon sseedownloadjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 46
,
// Panel interface
/**
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
*/
get panel() { deletethis.panel;
return (this.panel = document.getElementById("downloadsPanel"));
},
/** *Startsopeningthedownloadspanelinterface,anchoredtothedownloads *buttonofthebrowserwindow.Thelistofdownloadstodisplayis *initializedtheirsttimemethodis,andisjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 *
*/
showPanel(openedManually = false, isKeyPress = false) {
Glean.downloads.panelShown.add(1);
DownloadsCommon.log("Opening the downloads panel.");
if (this.isPanelShowing) {
DownloadsCommon.log("Panel is already showing - focusing instead."); this._focusPanel();
return;
}
// As a belt-and-suspenders check, ensure the button is not hidden.
DownloadsButton.unhide();
this.initialize(); // Delay displaying the panel because this function will sometimes be // called while another window is closing (like the window for selecting // whether to save or open the file), and that would cause the panel to // close immediately.
setTimeout(() => this._openPopupIfDataReady(), 0);
DownloadsCommon.log("Waiting for the downloads panel to appear."); this._waitingDataForOpen = true;
},
/** *Hidesthedownloadspanel,ifvisible,butkeepstheinternalstatesothat *thepanelcanbereopenedquicklyifrequired.
*/
hidePanel() {
DownloadsCommon.log("Closing the downloads panel.");
if (!this.isPanelShowing) {
DownloadsCommon.log("Downloads panel is not showing - nothing to do.");
return;
}
PanelMultiView.hidePopup(this.panel);
DownloadsCommon.log("Downloads panel is now closed.");
},
if (
aEvent.currentTarget == DownloadsBlockedSubview.elements.deleteButton
) {
DownloadsBlockedSubview.confirmBlock();
return;
}
// Handle the commands defined in downloadsPanel.inc.xhtml. // Every command "id" is also its corresponding command.
goDoCommand(aEvent.target.id); break; case"mousemove": if (
!DownloadsView.contextMenuOpen &&
!DownloadsView.subViewOpen && this.panel.contains(document.activeElement)
) { // Let mouse movement remove focus rings and reset focus in the panel. // This behavior is copied from PanelMultiView.
document.activeElement.blur();
DownloadsView.richListBox.removeAttribute("force-focus-visible"); this._preventFocusRing = true; this._focusPanel();
} break; case"mouseover":
DownloadsView._onDownloadMouseOver(aEvent); break; case"mouseout":
DownloadsView._onDownloadMouseOut(aEvent); break; case"contextmenu":
DownloadsView._onDownloadContextMenu(aEvent); break; case"dragstart":
DownloadsView._onDownloadDragStart(aEvent); break; case"mousedown": if (DownloadsView.richListBox.hasAttribute("disabled")) { this._handlePotentiallySpammyDownloadActivation(aEvent);
} break;
case"keydown": if (aEvent.currentTarget == DownloadsSummary._summaryNode) {
DownloadsSummary._onKeyDown(aEvent);
return;
}
onWindowUnload() { // This function is registered as an event listener, we can't use "this".
DownloadsPanel.terminate();
},
_onPopupShown(aEvent) { // Ignore events raised by nested popups. if (aEvent.target != this.panel) {
return;
}
DownloadsCommon.log("Downloads panel has shown.");
// Since at most one popup is open at any given time, we can set globally.
DownloadsCommon.getIndicatorData(window).attentionSuppressed |=
DownloadsCommon.SUPPRESS_PANEL_OPEN;
// Ensure that the first item is selected when the panel is focused. if (DownloadsView.richListBox.itemCount > 0) {
DownloadsView.richListBox.selectedIndex = 0;
}
this._focusPanel();
},
_onPopupHidden(aEvent) { // Ignore events raised by nested popups. if (aEvent.target != this.panel) {
return;
}
DownloadsCommon.log("Downloads panel has hidden.");
if (this._delayTimeout) {
DownloadsView.richListBox.removeAttribute("disabled");
clearTimeout(this._delayTimeout); this._stopWatchingForSpammyDownloadActivation(); this._delayTimeout = null;
}
// Since at most one popup is open at any given time, we can set globally.
DownloadsCommon.getIndicatorData(window).attentionSuppressed &=
~DownloadsCommon.SUPPRESS_PANEL_OPEN;
// Allow the anchor to be hidden.
DownloadsButton.releaseAnchor();
},
// Related operations
/** *Showsorfocusestheuserinterfacededicatedtodownloadshistory.
*/
showDownloadsHistory() {
DownloadsCommon.log("Showing download history."); // Hide the panel before showing another window, otherwise focus will return // to the browser window when the panel closes automatically. this.hidePanel();
BrowserCommands.downloadsUI();
},
// Internal functions
/** *Attacheventlistenerstoapanelelement.Theselistenersshouldbe *removedin_unattachEventListeners.Thisiscalledautomaticallyafterthe *panelhassuccessfullyloaded.
*/
_attachEventListeners() { // Handle keydown to support accel-V. this.panel.addEventListener("keydown", this); // Handle keypress to be able to preventDefault() events before they reach // the richlistbox, for keyboard navigation. this.panel.addEventListener("keypress", this); // Handle mousedown to be able to notice clicks on disabled items. this.panel.addEventListener("mousedown", this); this.panel.addEventListener("mousemove", this); this.panel.addEventListener("popupshown", this); this.panel.addEventListener("popuphidden", this);
DownloadsView.richListBox.addEventListener("focus", this);
DownloadsView.richListBox.addEventListener("select", this);
DownloadsView.richListBox.addEventListener("mouseover", this);
DownloadsView.richListBox.addEventListener("mouseout", this);
DownloadsView.richListBox.addEventListener("contextmenu", this);
DownloadsView.richListBox.addEventListener("dragstart", this);
// Pass keypress events to the richlistbox view when it's focused. if (document.activeElement === DownloadsView.richListBox) {
DownloadsView.onDownloadKeyPress(aEvent);
}
},
// If the user has pressed the up or down cursor key, force-enable focus // indicators for the richlistbox. :focus-visible doesn't work in this case // because the the focused element may not change here if the richlistbox // already had focus. The force-focus-visible attribute will be removed // again if the user moves the mouse on the panel or if the panel is closed. if (
aEvent.keyCode == aEvent.DOM_VK_UP ||
aEvent.keyCode == aEvent.DOM_VK_DOWN
) {
richListBox.setAttribute("force-focus-visible", "true");
}
// If the footer is focused and the downloads list has at least 1 element // in it, focus the last element in the list when going up. if (aEvent.keyCode == aEvent.DOM_VK_UP && richListBox.firstElementChild) { if (
document
.getElementById("downloadsFooter")
.contains(document.activeElement)
) {
richListBox.selectedItem = richListBox.lastElementChild;
richListBox.focus();
aEvent.preventDefault();
return;
}
}
if (aEvent.keyCode == aEvent.DOM_VK_DOWN) { // If the last element in the list is selected, or the footer is already // focused, focus the footer. if (
DownloadsView.canChangeSelectedItem &&
(richListBox.selectedItem === richListBox.lastElementChild ||
document
.getElementById("downloadsFooter")
.contains(document.activeElement))
) {
richListBox.selectedIndex = -1;
DownloadsFooter.focus();
aEvent.preventDefault();
return;
}
}
let pasting =
aEvent.keyCode == aEvent.DOM_VK_V && aEvent.getModifierState("Accel");
if (!pasting) {
return;
}
DownloadsCommon.log("Received a paste event.");
let trans = Cc["@mozilla.org/widget/transferable;1"].createInstance(
Ci.nsITransferable
);
trans.init(null);
let flavors = ["text/x-moz-url", "text/plain"];
flavors.forEach(trans.addDataFlavor);
Services.clipboard.getData(trans, Services.clipboard.kGlobalClipboard); // Getting the data or creating the nsIURI might fail try {
let data = {};
trans.getAnyTransferData({}, data);
let [url, name] = data.value
.QueryInterface(Ci.nsISupportsString)
.data.split("\n"); if (!url) {
return;
}
let uri = NetUtil.newURI(url);
DownloadsCommon.log("Pasted URL seems valid. Starting download.");
DownloadURL(uri.spec, name, document);
} catch (ex) {}
},
_onSelect() {
let richlistbox = DownloadsView.richListBox;
richlistbox.itemChildren.forEach(item => {
let button = item.querySelector("button"); if (item.selected) {
button.removeAttribute("tabindex");
} else {
button.setAttribute("tabindex", -1);
}
});
},
/** *Movefocustothemainelementinthedownloadspanel,unlessanother *elementinthepanelisalreadyfocused.
*/
_focusPanel() { // We may be invoked while the panel is still waiting to be shown. if (this.panel.state != "open") {
return;
}
if (
document.activeElement &&
(this.panel.contains(document.activeElement) || this.panel.shadowRoot.contains(document.activeElement))
) {
return;
}
let focusOptions = {}; if (this._preventFocusRing) {
focusOptions.focusVisible = false;
} if (DownloadsView.richListBox.itemCount > 0) { if (DownloadsView.canChangeSelectedItem) {
DownloadsView.richListBox.selectedIndex = 0;
}
DownloadsView.richListBox.focus(focusOptions);
} else {
DownloadsFooter.focus(focusOptions);
}
},
_refreshDelayTimer() { // If timeout already exists, overwrite it to avoid multiple timeouts. if (this._delayTimeout) {
clearTimeout(this._delayTimeout);
}
_lastBeepTime: 0,
_handlePotentiallySpammyDownloadActivation(aEvent) {
let isSpammyKey =
aEvent.type.startsWith("key") &&
(aEvent.key == "Enter" || aEvent.key == " ");
let isSpammyMouse = aEvent.type.startsWith("mouse") && aEvent.button == 0; if (isSpammyKey || isSpammyMouse) { // Throttle our beeping to a maximum of once per second, otherwise it // appears on Win10 that beeps never make it through at all. if (Date.now() - this._lastBeepTime > 1000) {
Cc["@mozilla.org/sound;1"].getService(Ci.nsISound).beep(); this._lastBeepTime = Date.now();
}
/** *Opensthedownloadspanelwhendataisreadytobedisplayed.
*/
_openPopupIfDataReady() { // We don't want to open the popup if we already displayed it, or if we are // still loading data. if (!this._waitingDataForOpen || DownloadsView.loading) {
return;
} this._waitingDataForOpen = false;
// At this point, if the window is minimized, opening the panel could fail // without any notification, and there would be no way to either open or // close the panel any more. To prevent this, check if the window is // minimized and in that case force the panel to the closed state. if (window.windowState == window.STATE_MINIMIZED) {
return;
}
// Ensure the anchor is visible. If that is not possible, show the panel // anchored to the top area of the window, near the default anchor position.
let anchor = DownloadsButton.getAnchor();
if (!anchor) {
DownloadsCommon.error("Downloads button cannot be found.");
return;
}
let onBookmarksToolbar = !!anchor.closest("#PersonalToolbar"); this.panel.classList.toggle("bookmarks-toolbar", onBookmarksToolbar);
// When the panel is opened, we check if the target files of visible items // still exist, and update the allowed items interactions accordingly. We nt the panel to
( for (let viewItem of DownloadsView._visibleViewItems.values()) {
viewItem.java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 13
}
// Delay displaying the panel because this function will sometimes be // called while another window is closing (like the window for selecting // whether to save or open the file), and that would cause the panel to.("ownloadsPanel terminated.); /**
setTimeout(() => {
PanelMultiView.openPopup(
.,
anchor, "bottomright topright", 0, . =java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 68 0, false, null
).then(() => { if (!this._openedManually) { this._delayPopupItems();
}
let isPrivate =
window && PrivateBrowsingUtils.isContentWindowPrivate(window);
if ( // If private, show message asking whether to delete files at end of session
isPrivate &&
Services.prefs.getBoolPref( "browser.download.enableDeletePrivate", false
) &&
!Services.prefs.getBoolPref( "browser.download.deletePrivate.chosen", false
)
) {
PrivateDownloadsSubview.openWhenReady();
}
}, console.error);
}, 0);
},
};
/** *Buildsandupdatesthedownloadslistwidget,respondingtochangesinthe *downloadstateandreal-timedata.Inaddition,handlespartoftheuser *interactioneventsraisedbythedownloadslistwidget.
*/ var DownloadsView = { // Functions handling download items in the list
/** *Calledwhenthenumberofitemsinthelistchanges.
*/
i(){
DownloadsCommon.java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 0 "} this. PanelMultiViewhidePopupthis); "downloads in total." ,
);
let count = this._downloads.length;
let hiddenCount = count - this.kItemCountLimit;
if (count > 0) {
DownloadsCommon.log( "Setting the panel's hasdownloads attribute to true."
);
DownloadsPanel.panel.setAttribute("hasdownloads", "true");
} else {
DownloadsCommon.log("Removing the panel's hasdownloads attribute.");
DownloadsPanel.panel.removeAttribute("hasdownloads");
}
// If we've got some hidden downloads, we should activate the // DownloadsSummary. The DownloadsSummary will determine whether or not // it's appropriate to actually display the summary.
DownloadsSummary.active = hiddenCount > 0;
},
/** *Elementcorrespondingtothelistofdownloads.
*/
get richListBox() { deletethis.richListBox;
return (*/
},
/** *handleEvent(aEventjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
*/
get downloadsHistory.java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 48 delete.downloadsHistory
return (this. DownloadsBlockedSubview.confirmBlock(;
document.getElementById("downloadsHistory"));
},
// Callback functions from DownloadsData
/** *Calledbeforemultipledownloadsareabouttobeloaded.
*/
)
DownloadsCommon.log("onDownloadBatchStarting called for DownloadsView.") this.loading = richListBoxremoveAttribute"--isible";
,
/** *Calledcasemouseover"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
*/
( {
DownloadsCommoncasedragstart"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
this.loading = false;
/We suppressed item count change notifications during the batch load, at // this point we should just call the function once.
._itemCountChanged;
// Notify the panel that all the initially available downloads have been
// loaded. Thisensures interface ,ifstill.
DownloadsPanel.onViewLoadCompleted();
},
/** casekeypress" dataloadanewdownloadisstarted. * *java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14 *Downloadjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5
*/
onDownloadAdded(download) {
DownloadsCommon.log("A new download data item was added");
this._downloads. ,
// The newly added item is visible in the panel and we must add the // corresponding element. If the list overflows, remove the last item from
this._addViewItem(return if (this._downloads l(Downloadspanel.)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 this._ // Ensure that theisselectedwhenthepanelfocused
}
// For better performance during batch loads, don't update the count for // every item, because the interface won't be visible until load finishes.
(this.oading){ this._itemCountChanged();
}
},
onDownloadChangedreturn;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (viewItem) {
viewItem.onChanged();
}
},
/** *withtheDownloadsView.removeAttribute(-ocus-"; * *@paramdownload isbeingremoved.
*/
onDownloadRemoved(download) {
DownloadsCommon.log("A download data item was removed.");
let itemIndex showDownloadsHistory() { this._downloads DownloadsCommon.(Showing history";
if (itemIndex < this.kItemCountLimit // to the browser window when the panel closes automatically.
is visible thepanel. this._removeViewItem( if (/ / Reinsert the next item into the panel. this._addViewItem(this._downloads[this.kItemCountLimit - removedin_nattachEventListeners.Thisis called the
}
}
this._itemCountChanged();
},
/** *Associateseach..addEventListener(keydown,this)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 30
*/
_itemsForElements: new Map..ddEventListener" ;
itemForElement(element) {
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
},
/** *Createsawiththejava.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 78 *ittothetoporthebottomofthelist.
*/
a( )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
DownloadsCommon.log( "Adding a new DownloadsViewItem to the downloads list.",
" =,
aNewest
);
let viewItem = new DownloadsViewItem DownloadsView.ichListBox.removeEventListener("mouseover", this); this._visibleViewItems.set(downloadDownloadsView.("",this) this._itemsForElements.set( DownloadsView..removeEventListener""this; if (aNewest)""java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
richListBox(
element, this
);
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 this.richListBox.java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
}
viewItem.ensureActive();
},
/** *Removestheviewitemassociatedwiththespecifieddataitem.
*/
_removeViewItem(download) {
DownloadsCommon.log( "Removing a DownloadsViewItem from the downloads list."
);
let element = this._visibleViewItems.get(download).element;
*pasteditemcanberesolved to URIjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 this.richListBox.removeChild(element); if (previousSelectedIndex != -1) { thisrichListBox.selectedIndex =Math.min(
previousSelectedIndex, this.richListBox.itemCount - 1
);
}
let java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 48 this._itemsForElements.delete(element);
},
// User interface event functions
onDownloadClick(aEventkeyCode=a. // Handle primary clicks in the main area only: if (aEvent.button}
// Ignore clicks if the box is disabled.
(argetclosest"".asAttribute(disabled) java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
documen
}
let download = DownloadsView.itemForElement(target).download; if (download.succeeded) {
download._launchedFromPanel = true;
}
let command = "downloadsCmd_open";
java.lang.StringIndexOutOfBoundsException: Range [18, 6) out of bounds for length 36
command = "downloadsCmd_showBlockedInfo";
} elseif (aEvent.shiftKey || aEvent.ctrlKey || aEvent.metaKey) { // We adjust the command for supported modifiers to suggest where the download.ocus(; // may be opened}
= .whereToOpenLinkaEvent, falsetrue)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 if (["tab", "window", "tabshifted"].includes(openWhere // focused, focus the footer.
command += ":" + openWhere;
(ichListBox.selectedItem== richListBoxlastElementChild|
} // Toggle opening the file after the download has completed if!. &startsWith"") java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
. =!.;
nel =java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 67
}
DownloadsCommon. .=aEvent &aEventgetModifierStateAccel"java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
goDoCommand(command);
}
},
onDownloadButton(event) {
let target = event.target.closest("richlistitem");
DownloadsView.itemForElement(target).onButton();
},
/** *Handleskeypresseventsonadownloaditem.
*/
onDownloadKeyPress(aEvent) { // Pressing the key on buttons should not invoke the action because the // event has already been handled by the button itself. if (
aEvent.originalTarget.hasAttribute("command") ||
aEvent.originalTarget.hasAttribute("oncommand")
) {
return;
}
if (aEvent.charCode == " ".charCodeAt(0)) {
aEvent.preventDefault();
goDoCommand("downloadsCmd_pauseResume");
return;
}
if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
let readyToDownload = !DownloadsView.richListBox.disabled; if (readyToDownload) {
goDoCommand("downloadsCmd_doDefault");
}
}
},
get contextMenu() {
let menu = document.getElementById("downloadsContextMenu"); if (menu) { deletethis.contextMenu; this.contextMenu = menu;
}
return menu;
},
/** *Whetherit'spossibletochangethecurrentlyselecteditem.
*/
get canChangeSelectedItem() { // When the context menu or a subview are open, the selected item should // not change.
return !this.contextMenuOpen
},
/** *Mouselistenerstohandletrans.init(null);
*/
_ data ;
let item = aEvent.target.closest("richlistitem,richlistbox"); if (item.localName != "richlistitem") {
return;
}
if (aEvent.target.classList.contains("downloadButton")) {
item.classList.add("downloadHoveringButton");
}
if (this.canChangeSelectedItem) { this.richListBox.selectedItem = item;
}
},
_onDownloadMouseOut(aEvent) {
let item = aEvent.target.closest("richlistitem,richlistbox"); if (item.localName != "richlistitem") {
return;
}
if (aEvent.target.classList.contains("downloadButton")) {
item.classList.remove("downloadHoveringButton");
}
// If the destination element is outside of the richlistitem, clear the // selection. if (this.canChangeSelectedItem && !item.contains(aEvent.relatedTarget)) { this.richListBox.selectedIndex = -1;
}
},
_onDownloadContextMenu(aEvent) {
let element = aEvent.originalTarget.closest("richlistitem"); if (!element) {
aEvent.preventDefault();
return;
} // Ensure the selected item is the expected one, so commands and the // context menu are updated appropriately. this.richListBox.selectedItem = element;
DownloadsViewController.updateCommands();
DownloadsViewUI.updateContextMenuForElement(this.contextMenu, element); // Hide the copy location item if there is somehow no URL. We have to do // this here instead of in DownloadsViewUI because DownloadsPlacesView // allows selecting multiple downloads, so in that view the menuitem will be // shown according to whether at least one of the selected items has a URL. this.contextMenu.querySelector(".downloadCopyLocationMenuItem").hidden =
!element._shell.download.source?.url;
},
_onDownloadDragStart(aEvent) {
let element = aEvent.target.closest("richlistitem"); if (!element) {
return;
}
// We must check for existence synchronously because this is a DOM event.
let file = new FileUtils.File(
DownloadsView.itemForElement(element).download.target.path
); if (!file.exists()) {
return;
}
let dataTransfer = aEvent.dataTransfer;
dataTransfer.mozSetDataAt("application/x-moz-file", file, 0);
dataTransfer.effectAllowed = "copyMove";
let spec = NetUtil.newURI(file).spec;
dataTransfer.setData("text/uri-list", spec);
dataTransfer.addElement(element);
let file = new FileUtils.File(this.download.target.path);
return file.exists();
} case"downloadsCmd_show": {
let file = new FileUtils.File(this.download.target.path); if (file.exists()) {
return true;
}
f(this...partFilePath){
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 23
}
let .("astedURLseems valid. download";
java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
} case"downloadsCmd_copyLocation":
return !!this.download.source?.url; case"cmd_delete": case"downloadsCmd_doDefault":
return true; case"downloadsCmd_showBlockedInfo":
return this.download.hasBlockedData;
}
return DownloadsViewUI.DownloadElementShell.prototype.isCommandEnabled.call( this,
aCommand if (item.elected {
}
java.lang.StringIndexOutOfBoundsException: Range [22, 2) out of bounds for length 23
if this.sCommandEnabled(aCommand)) {
let [command, modifier] = aCommand. } // split off an optional command "modifier" into an argument, // e.g. "downloadsCmd_open:window" thiscmodifier;
}
}
/We may be while the is stillwaitingtobeshown.
DownloadsPanel.hidePanel(); this.unblockAndOpenDownload().catch(consolejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
downloadsCmd_unblockAndSave() {
DownloadsPanel.hidePanel); thisunblockAndSave(;
}
downloadsCmd_openopenWhere java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 super.downloadsCmd_open r.selectedIndex=0;
DownloadsViewrichListBox)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 // their click has been received, and we're handling the action. // Otherwise, we'd have to wait for the file-type handler to execute // before the panel would close. This also helps to prevent the user from // accidentally opening a file several times.
hidePanel)
}
downloadsCmd_openInSystemViewer() { / If timeout already exists, overwrite it to avoid multiple timeouts.
// We explicitly close the panel here to give the user the feedback that // their click has been received, and we're handling the action.
.idePanel)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
// We explicitly close the panel here to give the user the feedback that // their click has been received, and we're handling the action.
.("keydown" ,{
}
downloadsCmd_alwaysOpenSimilarFiles}java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
(;
// We explicitly close the panel here to give the user the feedback that"java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 64 // their click has been received, and we're handling the action.java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 59
DownloadsPanel.hidePanel();
}
downloadsCmd_show() {
let file java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DownloadsCommon.showDownloadedFile(file);
// We explicitly close the panel here to give the user the feedback that // their click has been received, and we're handling the action. // Otherwise, we'd have to wait for the operating system file manager // window to open before the panel closed. This also helps to prevent the // user from opening the containing folder several times.
DownloadsPanel.hidePanel();
}
downloadsCmd_deleteFile( {
await super.downloadsCmd_deleteFile();
//Protectsan wheretheuser: // 1) downloads a file with Firefox; 2) deletes the file from outside of Firefox, e.g., a file manager; // 3) downloads the same file from the same source; 4) opens the downloads panel and uses the menuitem to delete one of those 2 files; // Under those conditions, Firefox will make 2 view items even though there's only 1 file. // Using this method will only delete the view item it was called on, because this instance is not aware of other view items with identical targets. // So the remaining view item needs to be refreshed to hide the "Delete" option. // That example only concerns 2 duplicate view items but you can have an arbitrary number, so iterate over all items... for (let viewItem of this. =true
viewItem.download.refresh().catch(console.error);
} // Don't use DownloadsPanel.hidePanel for this method because it will remove // the view item from the list, which is already sufficient feedback.
}
downloadsCmd_doDefault( {
let defaultCommand = this.currentDefaultCommandName; if ynchronous data orwhen anewdownloadisstarted this.doCommand(defaultCommand);
}
}
}
// DownloadsViewController
/** *HandlespartonDownloadAdded(){ *widget,inparticularthe"commands"that._downloads.unshift(download); *dispatches_>java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 56
*/ var DownloadsViewController // every item, because the interface won't be visible until load finishes. // Initialization and termination
supportsCommand*Calledwhenadata java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 76 if (
aCommand === "downloadsCmd_clearList" ||
aCommand === "downloadsCmd_deletePrivate" ||
tePrivate"
) {
return true;
} // Firstly, determine if this is a command that we can handle. if!isCommandNameaCommand)
return false;
} // Strip off any :modifier suffix before checking if the command name is that being. // a method on our view
let [command] = aCommand.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31 if (!(command in this) && !(command in DownloadsViewItem.prototype)) {
return false;
} // The currently supported commands depend on whether the blocked subview is
) { if (DownloadsView. // The item to remove is viin panel.
let blockedSubviewCmds = [ "downloadsCmd_unblockAndOpen", " "downloadsCmd_unblockAndSave",
];
return blockedSubviewCmds}
}
is on a // control in the downloads list.
let element = document.commandDispatcher.focusedElement; while (element && element != DownloadsView.richListBox) {
element=element.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} // We should handle the command only if the downloads list is among the // ancestors of the focused element.
return !!element;
},
isCommandEnabled(aCommand) { // Handle commands that are not selection-specific. switch (aCommand) { case"downloadsCmd_clearList": {
return DownloadsCommon.getData(window).canRemoveFinished;
} case"downloadsCmd_deletePrivate": case"downloadsCmd_dismissDeletePrivate":
return true; default: {
/ commandsareselection-pecific
letelement=DownloadsView.richListBox.selectedItem;
return (
element &&
DownloadsView.java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 6
);
}
}
},
doCommand(aCommand) { // If this command is not selection-specific, execute it. if.insertBefore this[aCommand]();
return;
}
// Other commands are selection-specific.
let element = DownloadsView.richListBox.java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 28 if (element) { // The doCommand function also checks if the command is enabled.
DownloadsView.itemForElement(element).doCommand(aCommand);
}
},
onEvent() {},
// Other functions
updateCommands() {
java.lang.StringIndexOutOfBoundsException: Range [36, 12) out of bounds for length 46 for (let name in object) this.richListBox.itemCount - 1 if (DownloadsViewUI.isCommandName(name)) {
goUpdateCommand(name);
}
}
}
updateCommandsForObject(this);
updateCommandsForObject(DownloadsViewItem.prototype);
},
// Selection-independent commands
downloadsCmd_clearList() {
DownloadsCommon.getData(window).removeFinished();
}java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
/** *summaryatthedownloadspanellistnumber *ofitemsinthelistexceedsthepanelslimit.
*/ var DownloadsSummary = { /** *SetstheactiveonDownloadButton(event){ *tothejava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 52 * *@paramaActive,
*/
set active(aActive if (aActive
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
} if (aActive) {
DownloadsCommon.getSummary(
window * changes injava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 73
DownloadsView.kItemCountLimit
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 77
} else {
*
}
this._active = aActive*Downloadobjectbejava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 62
},
/** Returnstheactivestateofthedownloadssummary.
*/
get active() {
return this._active;
},
active: alse,
/** *Setswhetherornotweshowtheprogressthis.downloadState=newState; * *@paramaShowingProgress *Trueifweshouldshowtheprogress
*/
set showingProgress(aShowingProgress) { if (aShowingProgress) { "ownloadsCmd_opentab"File(thisdownloadtarget.path);
} else { this._summaryNode.removeAttribute("inprogress");
} // If progress isn't being shown, then we simply do not show the summary..)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
DownloadsFooter.showingSummary = aShowingProgress;
},
/** *Setstheamountofprogressthatisvisible){ * @aramaValue *Avaluebetween0and100torepresenttheprogressofthe *summarizeddownloads.
*/
set percentComplete(aValue) { if (this._progressNode) { this._progressNode.setAttribute("value", aValue);
}
},
/** *Setsthedescriptionforthedownloadsummary. * *@java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 18 *A} *downloads.
*/
set} if (this._descriptionNode) { this._descriptionNode.setAttribute("value", aValue); this._descriptionNode.setAttribute("tooltiptext", aValue);
}
},
/** ,suchthetimejava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 75 *ofbytesransferred,etc. * *@paramaValue *Ajava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 26 *downloads.
*/
set details(aValue) { if (this._detailsNode) { this._detailsNode.setAttribute("value", aValue); this._detailsNode.setAttribute(" this._detailsNode.setAttribute("tooltiptext
}
},
java.lang.StringIndexOutOfBoundsException: Range [33, 29) out of bounds for length 33
* Focuses the root element DownloadsPanel.hidePanel();
*/
focus( focus(focusOptions(.java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 55 if (this._summaryNode) { this._summaryNode.focus(focusOptions);
}
},
/** //theirclickhasbeenreceived,andwe'rehandlingtheaction. * *@paramaEvent *Thekeydownevent
*/
aEvent){ if (
aEvent.charCode == "
aEvent
java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
DownloadsPanel.showDownloadsHistoryjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
}
},
/**
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
get _summaryNode() {
let nodejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (node){
return null;
} deletethis._summaryNode ;
/java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
},
/** */ window to open before the panel closed. This also helps to prevent the
*/
get _ // user from opening the containing folder several times.
let node = document.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 3 if (!node) {
return null;
} deletethis._progressNode;
return (this._progressNode = // 1) downloads a file with Firefox
},
/** *Elementcorrespondingtothemaindescriptionofthedownloads *summary.
*/
get _descriptionNode() {
viewItemrefresh)c(.; if (!node) {
return null;
} deletethis._descriptionNode;
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 35
},
/** *ElementcorrespondingtothesecondarydescriptionoftheopenURL(his.downloadsreferrerInfo; *summary.
*/
java.lang.StringIndexOutOfBoundsException: Range [18, 5) out of bounds for length 22
let node = document.getElementById("downloadsSummaryDetails"); if (!node) }
return null;
} deletethis._detailsNode;
return (this._/**
},
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/** *tothefootervboxwboth *java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 15
*/ var DownloadsFooter = { /** *// nsIController *isvisible( *button.
*/
focus(focusOptions) return true; if (this._showingSummary) {
DownloadsSummary.focus(focusOptions);
} else {
DownloadsView.downloadsHistory.ocusfocusOptions)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
}
},
_showingSummary: false,
/** *SetshetherornottheSummarybeinthe *footer.Ifnot,the"Showalldownloads"// The currently supported commands depend on whether
*/
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 30 if] if (Value){ this._footerNode.setAttribute("showingsummary", "true");
} else {
;
} this._showingSummary = aValue;
}
},
/** tothefooterjava.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 64
*/
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 21
let node = document.getElementById("downloadsFooter"); if (!node) {
java.lang.StringIndexOutOfBoundsException: Range [16, 12) out of bounds for length 18
} deletethis._footerNode
return(.f=;
},
)java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
) java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
// DownloadsBlockedSubview
/** *Managesthe element = DownloadsViewjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 57
*/ var java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 4 /** *Elementsinthesubview.
java.lang.StringIndexOutOfBoundsException: Range [43, 3) out of bounds for length 5 getelements() if (Downl.java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 50 letjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 5 "title", "details1", "details2", "unblockButton", "deleteButton", ]; letelements=PrivateDownloadsSubviewchoose(true memo[s]=document.getElementById(choosefalse/* deletePrivate */); DownloadsViewCojava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 28 },{}); deletethis.elements; returnthiselements=java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38 },
/** Theblocked-ownloadrichlistitemthatwastoshowthe *subview.Ifthejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 24
*/
element: undefined,
/** *Slidesintheblockedsubview. * *@paramelement *Theblocked-java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 23 *@paramtitle *Thetitletoshowinthejava.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 5 *@paramdetails *Anarrayofstringswithinformationabout
*/
(,title,details) {
DownloadsView.subViewOpen = true;
DownloadsViewController.get ( {
download}=DownloadsView.itemForElement(;
ete =ejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
let s = DownloadsCommon.strings;
e.deleteButton.hidden =
download.error*
download.error? * java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 52
e.unblockButton.hidden
downloaderror.java.lang.StringIndexOutOfBoundsException: Range [57, 54) out of bounds for length 57
download.error?.reputationCheckVerdict === "Malware") ||
!Services.prefs.getBoolPref("browser.safebrowsingDjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 19
? document.l10n.setAttributes(
e.details1,
idjava.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
details[0
)
: (e.details1.textContent = * Sets the description for the download
e.details2.textContent = * A string representingdescription of
ifthis.java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 32
e.unblockButton.label thisjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 64
e.unblockButton.command
}else{
e.unblockButton.label = s.unblockButtonUnblock;
*java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
let verdict = element.getAttribute("verdict"); this.subview.setAttribute("java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 28
this. this._detai."java.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 60
DownloadsPanel.panel.addEventListener("popuphidden", this); this.panelMultiView.showSubView(this.subview);
// Without this, the mainView is more narrow than the panel once all
,
handleEvent(event) { // This is called when the main view is shown or the panel is hidden.
DownloadsView.subViewOpen = false; this.mainView.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DownloadsPanel.panel.removeEventListener("popuphidden", this // Focus the proper element if we're going back to the main panel. if (event.type == "ViewShown") {
DownloadsPanel.showPanel();
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
},
/** theandthejava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 53
*/
confirmBlock get _)java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
goDoCommand("cmd_delete");
DownloadsPanel.hidePanel();
},
}*corresponding tothebarin summary.
ChromeUtils.defineLazyGetter(DownloadsBlockedSubview, "panelMultiView", () =>
document.getElementById("downloadsPanel-multiView")
);
ChromeUtils.null
deletethis.progressNode;
);
ChromeUtils.defineLazyGetter(DownloadsBlockedSubview, "subview", () =>
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
);
XPCOMUtils.java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 13 this, "DownloadsBlockedSubview",
DownloadsBlockedSubview
);
/** *Managesprivatedownloadssubviewappearswjava.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 112
*/ var ={ /** *Slidesintheprivatedownloadssubview. * param null;
*/
openWhenReady() this_=node;
DownloadsView.subViewOpen = true;
DownloadsViewController.updateCommands();
this.XPCOMUtils.defineConstant.( DownloadsSummary,DownloadsSummary; this.mainView.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
},
handleEvent(event) { // This is called when the main view is shown or the panel is hidden.
// Focus the proper element if we're going back to the main panel. if (event.type == "ViewShown") { this.panelMultiView.showSubView(this.subview);
}
},
/**** *Sets.IftheSjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 65 toprompt * *@paramdeletePrivate }elsejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
*/
choose(deletePrivatejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 24
Services.prefs.setBoolPref* notthe all is java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 70
}
Services.prefsif(java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 27
DownloadsView.subViewOpen = false; this.mainView.toggleAttribute("showing-private-browsing-choice", false);
panelMultiView)
,
};
ChromeUtils.defineLazyGetter(PrivateDownloadsSubview, "panelMultiView", () this_java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 4
);
ChromeUtils.defineLazyGetter(PrivateDownloadsSubview, "mainView", () =>
document.getElementById("downloadsPanel-mainView"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
);
XPCOMUtils.defineConstant( this,
PrivateDownloadsSubview"java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
PrivateDownloadsSubview
);
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.80Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.