mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 04:03:47 +00:00
Bug 794407 - Web Activites should only be started by a user interaction. r=fabrice
This commit is contained in:
parent
5ab3b6cc6e
commit
039ea5bcef
@ -6,6 +6,7 @@
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDOMActivityOptions.h"
|
||||
#include "nsEventStateManager.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
@ -47,6 +48,14 @@ Activity::Initialize(nsISupports* aOwner,
|
||||
|
||||
Init(window);
|
||||
|
||||
if (!nsEventStateManager::IsHandlingUserInput()) {
|
||||
nsCOMPtr<nsIDOMRequestService> rs =
|
||||
do_GetService("@mozilla.org/dom/dom-request-service;1");
|
||||
rs->FireErrorAsync(static_cast<DOMRequest*>(this),
|
||||
NS_LITERAL_STRING("NotUserInput"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// We expect a single argument, which is a nsIDOMMozActivityOptions.
|
||||
if (aArgc != 1 || !aArgv[0].isObject()) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
Loading…
x
Reference in New Issue
Block a user