# HG changeset patch # User Peter Van der Beken # Date 1407945328 -7200 # Wed Aug 13 17:55:28 2014 +0200 # Node ID 257c086863cef71d08c527f18c042199fbeb2d19 # Parent 4bdf267a1b90f93acfde252008ce0390b09c764b Bug 1041808 - Thousands of about:blank windows when cookies policy set to "Keep until: I close Firefox". diff --git a/extensions/cookie/nsCookiePromptService.cpp b/extensions/cookie/nsCookiePromptService.cpp --- a/extensions/cookie/nsCookiePromptService.cpp +++ b/extensions/cookie/nsCookiePromptService.cpp @@ -8,16 +8,17 @@ #include "nsICookieAcceptDialog.h" #include "nsIDOMWindow.h" #include "nsPIDOMWindow.h" #include "nsIWindowWatcher.h" #include "nsIServiceManager.h" #include "nsString.h" #include "nsIDialogParamBlock.h" #include "nsIMutableArray.h" +#include "mozilla/dom/ScriptSettings.h" /**************************************************************** ************************ nsCookiePromptService ***************** ****************************************************************/ NS_IMPL_ISUPPORTS(nsCookiePromptService, nsICookiePromptService) nsCookiePromptService::nsCookiePromptService() { @@ -66,16 +67,18 @@ nsCookiePromptService::CookieDialog(nsID if (parent) { nsCOMPtr privateParent(do_QueryInterface(parent)); if (privateParent) privateParent = privateParent->GetPrivateRoot(); parent = do_QueryInterface(privateParent); } + 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 // avoids unwanted tab switches (see bug 405239). rv = wwatcher->OpenWindow(parent, "chrome://cookie/content/cookieAcceptDialog.xul", "_blank", "centerscreen,chrome,modal,titlebar", arguments, getter_AddRefs(dialog)); diff --git a/extensions/cookie/test/mochitest.ini b/extensions/cookie/test/mochitest.ini --- a/extensions/cookie/test/mochitest.ini +++ b/extensions/cookie/test/mochitest.ini @@ -33,8 +33,9 @@ support-files = [test_loadflags.html] [test_same_base_domain.html] [test_same_base_domain_2.html] [test_same_base_domain_3.html] [test_same_base_domain_4.html] [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 --- /dev/null +++ b/extensions/cookie/test/test_bug1041808.html @@ -0,0 +1,61 @@ + + + + + + Test for Bug 1041808 + + + + + + +Mozilla Bug 1041808 +

+ +
+
+ +