diff --git a/extensions/cookie/nsCookiePromptService.cpp b/extensions/cookie/nsCookiePromptService.cpp index 32c875d56b7..f50c077ce8f 100644 --- a/extensions/cookie/nsCookiePromptService.cpp +++ b/extensions/cookie/nsCookiePromptService.cpp @@ -13,6 +13,7 @@ #include "nsString.h" #include "nsIDialogParamBlock.h" #include "nsIMutableArray.h" +#include "mozilla/dom/ScriptSettings.h" /**************************************************************** ************************ nsCookiePromptService ***************** @@ -71,6 +72,11 @@ nsCookiePromptService::CookieDialog(nsIDOMWindow *aParent, parent = do_QueryInterface(privateParent); } + // We're opening a chrome window and passing in a nsIDialogParamBlock. Setting + // the nsIDialogParamBlock as the .arguments property on the chrome window + // requires system principals on the stack, so we use an AutoNoJSAPI for that. + mozilla::dom::AutoNoJSAPI nojsapi; + // The cookie dialog will be modal for the root chrome window rather than the // tab containing the permission-requesting page. This removes confusion // about which monitor is displaying the dialog (see bug 470356), but also diff --git a/extensions/cookie/test/mochitest.ini b/extensions/cookie/test/mochitest.ini index 794dce7d52e..0d5c8ec3832 100644 --- a/extensions/cookie/test/mochitest.ini +++ b/extensions/cookie/test/mochitest.ini @@ -38,3 +38,4 @@ support-files = [test_same_base_domain_5.html] [test_same_base_domain_6.html] [test_samedomain.html] +[test_bug1041808.html] diff --git a/extensions/cookie/test/test_bug1041808.html b/extensions/cookie/test/test_bug1041808.html new file mode 100644 index 00000000000..38a8832e0e9 --- /dev/null +++ b/extensions/cookie/test/test_bug1041808.html @@ -0,0 +1,61 @@ + + + +
+ +++ +