mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
Bug 36658; notify urlwidget component on page load; r=matt@netscape.com
This commit is contained in:
parent
624c6efef8
commit
0a3f8a2fd0
@ -413,6 +413,7 @@ function Startup()
|
||||
contentArea.addEventListener("load", UpdateInternetSearchResults, true);
|
||||
contentArea.addEventListener("load", getContentAreaFrameCount, true);
|
||||
contentArea.addEventListener("focus", contentAreaFrameFocus, true);
|
||||
contentArea.addEventListener("load",postURLToNativeWidget, true);
|
||||
}
|
||||
|
||||
dump("*** Pulling out the charset\n");
|
||||
@ -1566,3 +1567,23 @@ function clearErrorNotification()
|
||||
consoleListener.isShowingError = false;
|
||||
}
|
||||
|
||||
//Posts the currently displayed url to a native widget so third-party apps can observe it.
|
||||
var urlWidgetService = null;
|
||||
function postURLToNativeWidget() {
|
||||
var url = window._content.location.href;
|
||||
if ( !urlWidgetService ) {
|
||||
try {
|
||||
urlWidgetService = getService( "component://mozilla/urlwidget", "nsIUrlWidget" );
|
||||
} catch( exception ) {
|
||||
dump( "Error getting url widget service: " + exception + "\n" );
|
||||
}
|
||||
}
|
||||
if ( urlWidgetService ) {
|
||||
try {
|
||||
urlWidgetService.SetURLToHiddenControl( url, window );
|
||||
} catch( exception ) {
|
||||
dump( " SetURLToHiddenControl failed: " + exception + "\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user