Skip to content

Commit

Permalink
22183 - UI spoofing can cause user to mistake content for chrome. for…
Browse files Browse the repository at this point in the history
…ce the location bar to always be present.
  • Loading branch information
ben%bengoodger.com committed Sep 6, 2004
1 parent 8a6e703 commit e2a455b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 34 deletions.
4 changes: 4 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ pref("browser.bookmarks.sort.resource", "rdf:http://home.netscape.com/NC-rdf#Nam
pref("dom.disable_open_during_load", true);
pref("javascript.options.showInConsole", false);

// Make the location bar reliably present and unaffected by pages
pref("dom.disable_window_open_feature.location", true);
pref("dom.disable_window_status_change", true);

// popups.policy 1=allow,2=reject
pref("privacy.popups.policy", 1);
pref("privacy.popups.usecustom", true);
Expand Down
20 changes: 18 additions & 2 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ function delayedStartup()
.getService(Components.interfaces.nsIPrefService);
gPrefService = gPrefService.getBranch(null);

if (document.documentElement.getAttribute("chromehidden").indexOf("toolbar") != -1) {
gURLBar.setAttribute("readonly", "true");
gURLBar.setAttribute("enablehistory", "false");
}

BrowserOffline.init();

if (gIsLoadingBlank)
Expand Down Expand Up @@ -566,8 +571,19 @@ function delayedStartup()
}
#endif

var updatePanel = document.getElementById("statusbar-updates");
updatePanel.init();
var updatePanel = document.getElementById("updates");
try {
updatePanel.init();
}
catch (e) { }

// BiDi UI
if (isBidiEnabled()) {
document.getElementById("documentDirection-separator").hidden = false;
document.getElementById("documentDirection-swap").hidden = false;
document.getElementById("textfieldDirection-separator").hidden = false;
document.getElementById("textfieldDirection-swap").hidden = false;
}
}

function Shutdown()
Expand Down
61 changes: 31 additions & 30 deletions browser/base/content/browser.xul
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
</toolbar>

<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="back-button" type="menu-button" class="toolbarbutton-1"
<toolbarbutton id="back-button" type="menu-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&backCmd.label;"
oncommand="BrowserBack(event)"
onclick="checkForMiddleClick(this, event);"
Expand All @@ -156,7 +156,7 @@
onclick="checkForMiddleClick(this, event);"/>
</toolbarbutton>

<toolbarbutton id="forward-button" type="menu-button" class="toolbarbutton-1"
<toolbarbutton id="forward-button" type="menu-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&forwardCmd.label;"
oncommand="BrowserForward(event)"
onclick="checkForMiddleClick(this, event);"
Expand All @@ -169,22 +169,22 @@
onclick="checkForMiddleClick(this, event);"/>
</toolbarbutton>

<toolbarbutton id="reload-button" class="toolbarbutton-1"
label="&reloadCmd.label;"
oncommand="if (event.shiftKey) BrowserReloadSkipCache(); else BrowserReload();"
tooltiptext="&reloadButton.tooltip;"/>
<toolbarbutton id="reload-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&reloadCmd.label;"
oncommand="if (event.shiftKey) BrowserReloadSkipCache(); else BrowserReload();"
tooltiptext="&reloadButton.tooltip;"/>

<toolbarbutton id="stop-button" class="toolbarbutton-1"
label="&stopCmd.label;"
command="Browser:Stop"
tooltiptext="&stopButton.tooltip;"/>

<toolbarbutton id="home-button" class="toolbarbutton-1"
label="&homeButton.label;"
ondragover="nsDragAndDrop.dragOver(event, homeButtonObserver);"
ondragdrop="nsDragAndDrop.drop(event, homeButtonObserver);"
ondragexit="nsDragAndDrop.dragExit(event, homeButtonObserver);"
onclick="BrowserHomeClick(event);"/>
<toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&stopCmd.label;"
command="Browser:Stop"
tooltiptext="&stopButton.tooltip;"/>

<toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&homeButton.label;"
ondragover="nsDragAndDrop.dragOver(event, homeButtonObserver);"
ondragdrop="nsDragAndDrop.drop(event, homeButtonObserver);"
ondragexit="nsDragAndDrop.dragExit(event, homeButtonObserver);"
onclick="BrowserHomeClick(event);"/>

<toolbaritem id="urlbar-container" align="center" flex="1000"
title="&locationItem.title;" class="chromeclass-location">
Expand Down Expand Up @@ -220,7 +220,7 @@
</toolbaritem>

<toolbaritem id="search-container" align="center"
title="&searchItem.title;" class="chromeclass-location">
title="&searchItem.title;" class="chromeclass-additional">
<textbox id="search-bar" type="autocomplete" flex="1"
autocompletepopup="PopupAutoComplete"
autocompletesearch="form-history"
Expand All @@ -234,7 +234,7 @@
</textbox>
</toolbaritem>

<toolbaritem id="go-container" align="center" class="chromeclass-location">
<toolbaritem id="go-container" align="center" class="chromeclass-additional">
<button id="go-button" class="button-toolbar"
label="&goButton.label;"
oncommand="handleURLBarCommand(event);"
Expand All @@ -244,7 +244,7 @@
tooltiptext="&goButton.tooltip;"/>
</toolbaritem>

<toolbarbutton id="print-button" class="toolbarbutton-1"
<toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&printButton.label;" command="cmd_print"
tooltiptext="&printButton.tooltip;"/>

Expand All @@ -255,7 +255,8 @@
tooltiptext="&throbber.tooltip;"/>
</toolbaritem>

<toolbaritem id="personal-bookmarks" title="&bookmarksItem.title;" flex="1">
<toolbaritem id="personal-bookmarks" title="&bookmarksItem.title;" flex="1"
class="chromeclass-directories">
<stack id="bookmarks-stack" flex="1" style="min-width:0px; width:0px;"
onpopupshowing="BookmarksToolbar.setOpenedMenu(event);"
onpopuphidden="BookmarksToolbar.unsetOpenedMenu(event);">
Expand Down Expand Up @@ -301,7 +302,7 @@
</stack>
</toolbaritem>

<toolbarbutton id="downloads-button" class="toolbarbutton-1"
<toolbarbutton id="downloads-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
observes="Tools:Downloads"
ondragdrop="nsDragAndDrop.drop(event, DownloadsButtonDNDObserver); event.preventBubble()"
ondragover="nsDragAndDrop.dragOver(event, DownloadsButtonDNDObserver); event.preventBubble()"
Expand All @@ -310,12 +311,12 @@
label="&downloads.label;"
tooltiptext="&downloads.tooltip;"/>

<toolbarbutton id="history-button" class="toolbarbutton-1"
<toolbarbutton id="history-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
observes="viewHistorySidebar"
tooltiptext="&historyButton.tooltip;"/>

#ifdef HAVE_SHELL_SERVICE
<toolbarbutton id="mail-button" type="menu" class="toolbarbutton-1"
<toolbarbutton id="mail-button" type="menu" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&mailButton.label;" orient="vertical"
onmouseover="MailIntegration.updateUnreadCount();"
tooltiptext="&mailButton.tooltip;">
Expand All @@ -338,34 +339,34 @@
</toolbarbutton>
#endif

<toolbarbutton id="bookmarks-button" class="toolbarbutton-1"
<toolbarbutton id="bookmarks-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
observes="viewBookmarksSidebar"
tooltiptext="&bookmarksButton.tooltip;"
ondragover="nsDragAndDrop.dragOver(event, bookmarksButtonObserver);"
ondragdrop="nsDragAndDrop.drop(event, bookmarksButtonObserver);"
ondragexit="nsDragAndDrop.dragExit(event, bookmarksButtonObserver);"/>

<toolbarbutton id="new-tab-button" class="toolbarbutton-1"
<toolbarbutton id="new-tab-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&tabCmd.label;"
command="cmd_newNavigatorTab"
tooltiptext="&newTabButton.tooltip;"/>

<toolbarbutton id="new-window-button" class="toolbarbutton-1"
<toolbarbutton id="new-window-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&newNavigatorCmd.label;"
command="key_newNavigator"
tooltiptext="&newWindowButton.tooltip;"/>

<toolbarbutton id="cut-button" class="toolbarbutton-1"
<toolbarbutton id="cut-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&cutCmd.label;"
command="cmd_cut"
tooltiptext="&cutButton.tooltip;"/>

<toolbarbutton id="copy-button" class="toolbarbutton-1"
<toolbarbutton id="copy-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&copyCmd.label;"
command="cmd_copy"
tooltiptext="&copyButton.tooltip;"/>

<toolbarbutton id="paste-button" class="toolbarbutton-1"
<toolbarbutton id="paste-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&pasteCmd.label;"
command="cmd_paste"
tooltiptext="&pasteButton.tooltip;"/>
Expand Down
4 changes: 2 additions & 2 deletions toolkit/content/xul.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ window[chromehidden~="directories"] .chromeclass-directories,
window[chromehidden~="status"] .chromeclass-status,
window[chromehidden~="extrachrome"] .chromeclass-extrachrome,
window[chromehidden~="location"] .chromeclass-location,
window[chromehidden~="location"][chromehidden~="toolbar"] .chromeclass-toolbar
window[chromehidden~="location"][chromehidden~="toolbar"] .chromeclass-toolbar,
window[chromehidden~="toolbar"] .chromeclass-toolbar-additional
{
display: none;
}


/****** elements that have no visual representation ******/

script, data,
Expand Down

0 comments on commit e2a455b

Please sign in to comment.