mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 813828 - Allow chrome code to launch Web Activities [r=mounir]
This commit is contained in:
parent
2b7994071a
commit
e29652bb1f
@ -7,6 +7,7 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDOMActivityOptions.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIConsoleService.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
@ -52,11 +53,23 @@ Activity::Initialize(nsISupports* aOwner,
|
||||
|
||||
Init(window);
|
||||
|
||||
if (!nsEventStateManager::IsHandlingUserInput()) {
|
||||
nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument());
|
||||
|
||||
if (!nsEventStateManager::IsHandlingUserInput() &&
|
||||
!nsContentUtils::IsChromeDoc(document)) {
|
||||
nsCOMPtr<nsIDOMRequestService> rs =
|
||||
do_GetService("@mozilla.org/dom/dom-request-service;1");
|
||||
rs->FireErrorAsync(static_cast<DOMRequest*>(this),
|
||||
NS_LITERAL_STRING("NotUserInput"));
|
||||
|
||||
nsCOMPtr<nsIConsoleService> console(
|
||||
do_GetService("@mozilla.org/consoleservice;1"));
|
||||
NS_ENSURE_TRUE(console, NS_OK);
|
||||
|
||||
nsString message =
|
||||
NS_LITERAL_STRING("Can start activity from non user input or chrome code");
|
||||
console->LogStringMessage(message.get());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user