Skip to content

Review Feedback for FF17 #2027

Closed
brendandahl opened this Issue Aug 26, 2012 · 1 comment

2 participants

@brendandahl

::: browser/extensions/pdfjs/components/PdfStreamConverter.js
@@ +327,5 @@

  • }
  • if (!notificationBox) {
  • log('Unable to get a notification box for the fallback message');
  • return;
  • }

This is ok for now but I don't think you need the loop here, you can just directly get the main window for the child document using >something like this https://developer.mozilla.org/en-US/docs/Working_with_windows_in_chrome_code#Accessing_the_elements_of_the_top-level_document_from_a_child_window

I think there may also be a frameElement property on one of those interfaces that gives you the browser element for the child >window too.

@gavinsharp

All that code can just be:

var containingBrowser = domWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIDocShell).chromeEventHandler;
var chromeWindow = containingBrowser.ownerDocument.defaultView;
var notificationBox = chromeWindow.getNotificationBox(containingBrowser);

If you want to handle windows that aren't in Firefox chrome windows, you should null check chromeWindow.getNotificationBox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.