зеркало из https://github.com/mozilla/gecko-dev.git
partial fixes for 32347, 30536, 41120
This commit is contained in:
Родитель
8d503dde09
Коммит
a6234be1db
|
@ -438,6 +438,8 @@ function Startup()
|
|||
}
|
||||
if (homepage)
|
||||
setTooltipText("homebutton", homepage);
|
||||
|
||||
initConsoleListener();
|
||||
}
|
||||
|
||||
function Shutdown()
|
||||
|
@ -1220,14 +1222,6 @@ function BrowserEditBookmarks()
|
|||
window.open("chrome://messenger/content/addressbook/addressbook.xul", "_blank", "chrome,menubar,toolbar,resizable");
|
||||
}
|
||||
|
||||
function BrowserSendLink(pageUrl, pageTitle)
|
||||
{
|
||||
window.openDialog( "chrome://messenger/content/messengercompose/messengercompose.xul", "_blank",
|
||||
"chrome,all,dialog=no",
|
||||
"body='" + pageUrl + "',subject='" + pageTitle +
|
||||
"',bodyislink=true");
|
||||
}
|
||||
|
||||
function BrowserSendPage(pageUrl, pageTitle)
|
||||
{
|
||||
window.openDialog( "chrome://messenger/content/messengercompose/messengercompose.xul", "_blank",
|
||||
|
@ -1476,4 +1470,63 @@ function dumpMemoryLeaks() {
|
|||
if (leakDetector != null)
|
||||
leakDetector.dumpLeaks();
|
||||
}
|
||||
|
||||
|
||||
var consoleListener = {
|
||||
observe: function (aMsgObject)
|
||||
{
|
||||
const nsIScriptError = Components.interfaces.nsIScriptError;
|
||||
var scriptError = aMsgObject.QueryInterface(nsIScriptError);
|
||||
var isWarning = scriptError.flags & nsIScriptError.warningFlag != 0;
|
||||
if (!isWarning)
|
||||
{
|
||||
var statusbarDisplay = document.getElementById("statusbar-display");
|
||||
statusbarDisplay.setAttribute("error", "true");
|
||||
statusbarDisplay.addEventListener("click", loadErrorConsole, true);
|
||||
statusbarDisplay.value = bundle.GetStringFromName("jserror");
|
||||
this.isShowingError = true;
|
||||
}
|
||||
},
|
||||
|
||||
// whether or not an error alert is being displayed
|
||||
isShowingError: false,
|
||||
|
||||
};
|
||||
|
||||
function initConsoleListener()
|
||||
{
|
||||
var consoleService = nsJSComponentManager.getService("mozilla.consoleservice.1", "nsIConsoleService");
|
||||
|
||||
/**
|
||||
* XXX - console launch hookup requires some work that I'm not sure how to
|
||||
* do.
|
||||
*
|
||||
* 1) ideally, the notification would disappear when the document that had the
|
||||
* error was flushed. how do I know when this happens? All the nsIScriptError
|
||||
* object I get tells me is the URL. Where is it located in the content area?
|
||||
* 2) the notification service should not display chrome script errors.
|
||||
* web developers and users are not interested in the failings of our shitty,
|
||||
* exception unsafe js. One could argue that this should also extend to
|
||||
* the console by default (although toggle-able via setting for chrome authors)
|
||||
* At any rate, no status indication should be given for chrome script
|
||||
* errors.
|
||||
*
|
||||
* As a result I am commenting out this for the moment.
|
||||
**/
|
||||
//if (consoleService)
|
||||
// consoleService.registerListener(consoleListener);
|
||||
}
|
||||
|
||||
function loadErrorConsole(aEvent)
|
||||
{
|
||||
if (aEvent.detail == 2)
|
||||
toJavaScriptConsole();
|
||||
}
|
||||
|
||||
function clearErrorNotification()
|
||||
{
|
||||
var statusbarDisplay = document.getElementById("statusbar-display");
|
||||
statusbarDisplay.removeAttribute("error");
|
||||
statusbarDisplay.removeEventListener("click", loadErrorConsole, true);
|
||||
consoleListener.isShowingError = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,10 +24,10 @@ Contributor(s): ______________________________________. -->
|
|||
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://navigator/content/navigatorOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://navigator/content/NavSecurityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://navigator/content/navExtraOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/securityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
|
@ -109,6 +109,7 @@ Contributor(s): ______________________________________. -->
|
|||
value="&openLinkCmd.label;"
|
||||
accesskey=""
|
||||
oncommand="contextMenu.openLink();"/>
|
||||
<!-- XXX - DEPENDENT ON PRESENCE OF EDITOR!! - XXX -->
|
||||
<menuitem id="context-editlink"
|
||||
value="&editLinkCmd.label;"
|
||||
accesskey=""
|
||||
|
@ -163,7 +164,7 @@ Contributor(s): ______________________________________. -->
|
|||
oncommand="contextMenu.blockImage();"/>
|
||||
<menuseparator/>
|
||||
<!-- Misc ==================================== -->
|
||||
<menuitem id="context-bookmarkpage"
|
||||
<menuitem id="context-bookmarkpage"
|
||||
value="&bookmarkPageCmd.label;"
|
||||
accesskey="&bookmarkPageCmd.accesskey;"
|
||||
oncommand="BrowserAddBookmark( window.content.location.href,
|
||||
|
|
|
@ -39,7 +39,6 @@ Contributor(s): ______________________________________. -->
|
|||
<keyset id="keyset">
|
||||
<!-- File Menu -->
|
||||
<key id="key_newNavigator"/>
|
||||
<key id="key_newMessage"/>
|
||||
<key id="key_newBlankPage"/>
|
||||
<key id="openBrowserKb" xulkey="true" key="&openCmd.commandkey;" observes="Browser:Open" />
|
||||
<key id="openFileKb" xulkey="true" key="&openFileCmd.commandkey;" observes="Browser:OpenFile" />
|
||||
|
@ -86,12 +85,9 @@ Contributor(s): ______________________________________. -->
|
|||
<broadcasterset id="broadcasterset">
|
||||
<!-- File Menu -->
|
||||
<broadcaster id="cmd_newNavigator"/>
|
||||
<broadcaster id="cmd_newMessage"/>
|
||||
<broadcaster id="cmd_newCard"/>
|
||||
<broadcaster id="cmd_newEditor"/>
|
||||
<broadcaster id="cmd_newEditorTemplate"/>
|
||||
<broadcaster id="cmd_newEditorDraft"/>
|
||||
<broadcaster id="cmd_sendPage"/>
|
||||
<broadcaster id="cmd_quit"/>
|
||||
|
||||
<!-- Edit Menu -->
|
||||
|
@ -119,7 +115,6 @@ Contributor(s): ______________________________________. -->
|
|||
|
||||
<broadcaster id="cmd_close" oncommand="BrowserClose()"/>
|
||||
|
||||
<broadcaster id="Browser:SendLink" value="&sendLinkCmd.label;" oncommand="BrowserSendLink(window.content.location.href, window.content.document.title);"/>
|
||||
<broadcaster id="Browser:EditPage" value="&editPageCmd.label;" oncommand="BrowserEditPage(window.content.location.href);"/>
|
||||
|
||||
<broadcaster id="Browser:PrintSetup" value="&printSetupCmd.label;" disabled ="true" oncommand="BrowserReload();"/>
|
||||
|
@ -146,14 +141,12 @@ Contributor(s): ______________________________________. -->
|
|||
<!-- Menu -->
|
||||
<menubar id="main-menubar" class="chromeclass-menubar">
|
||||
<menu id="menu_File">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem value="&browserCmd.label;" accesskey="&browserCmd.accesskey;" key="key_newNavigator" observes="cmd_newNavigator"/>
|
||||
<menu id="menu_New">
|
||||
<menupopup id="menu_NewPopup">
|
||||
<!-- From globalOverlay.xul -->
|
||||
<menuitem id="menu_newNavigator" observes="cmd_newNavigator"/>
|
||||
<menuitem id="menu_newMessage" observes="cmd_newMessage"/>
|
||||
<menuitem id="menu_newCard" observes="cmd_newCard"/>
|
||||
<menuitem id="menu_newEditor" observes="cmd_newEditor"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
@ -164,8 +157,6 @@ Contributor(s): ______________________________________. -->
|
|||
<menuitem id="context-savepage" key="savePage" observes="Browser:SavePage"/>
|
||||
<menuitem id="savepage" value="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="savePage(gFocusedURL);" hidden="true"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_sendPage" observes="cmd_sendPage"/>
|
||||
<menuitem accesskey="&sendLinkCmd.accesskey;" observes="Browser:SendLink"/>
|
||||
<menuitem accesskey="&editPageCmd.accesskey;" observes="Browser:EditPage" />
|
||||
<menuseparator/>
|
||||
<menuitem accesskey="&printSetupCmd.accesskey;" observes="Browser:PrintSetup"/>
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
<!ENTITY openFileCmd.label "Open File...">
|
||||
<!ENTITY openFileCmd.accesskey "o">
|
||||
<!ENTITY openFileCmd.commandkey "o">
|
||||
<!ENTITY sendLinkCmd.label "Send Link">
|
||||
<!ENTITY sendLinkCmd.accesskey "i">
|
||||
<!ENTITY editPageCmd.label "Edit Page">
|
||||
<!ENTITY editPageCmd.accesskey "d">
|
||||
<!ENTITY editFrameCmd.label "Edit Frame">
|
||||
|
|
|
@ -18,3 +18,4 @@ droponhomemsg2=to be your new home page?
|
|||
dontremindme=Always check when I drag an address to the Home button (This can also be set in the 'Navigator' category of Preferences)
|
||||
droponhomeokbutton=Set Home Page
|
||||
|
||||
jserror=An error has occurred on this page. Double click here for details.
|
Загрузка…
Ссылка в новой задаче