Allow chrome code to launch Web Activities

RESOLVED FIXED in Firefox 18

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: fabrice, Assigned: fabrice)

Tracking

unspecified
mozilla20
All
Gonk (Firefox OS)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking-basecamp:+, firefox18 fixed, firefox19 fixed, firefox20 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 683840 [details] [diff] [review]
patch

Since bug 794407 we restrict web activities to be only launchable by user input. This breaks all use of web activities from chrome code such as protocol and content handlers.
Attachment #683840 - Flags: review?(mounir)
(Assignee)

Updated

6 years ago
blocking-basecamp: --- → ?
(Assignee)

Comment 1

6 years ago
Created attachment 683854 [details] [diff] [review]
patch v2

Simpler patch using nsContentUtils::IsChromeDoc
Assignee: nobody → fabrice
Attachment #683840 - Attachment is obsolete: true
Attachment #683840 - Flags: review?(mounir)
Attachment #683854 - Flags: review?(mounir)
Comment on attachment 683854 [details] [diff] [review]
patch v2

Review of attachment 683854 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the printf_stderr removed.

::: dom/activities/src/Activity.cpp
@@ +55,5 @@
> +  nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument());
> +
> +  if (!nsEventStateManager::IsHandlingUserInput() &&
> +      !nsContentUtils::IsChromeDoc(document)) {
> +    printf_stderr("!! Can start activity from non user input or chrome code.");

Could you remove this printf_stderr, please? :)

Feel free to write another patch to show something in the console, though. I think that would be handy for developers :)
Attachment #683854 - Flags: review?(mounir) → review+

Updated

6 years ago
blocking-basecamp: ? → +
(Assignee)

Updated

6 years ago
Blocks: 814072
https://hg.mozilla.org/mozilla-central/rev/7ae5ff606cf2
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
https://hg.mozilla.org/releases/mozilla-aurora/rev/871f22673ad8
https://hg.mozilla.org/releases/mozilla-beta/rev/bc5914b106a4
status-firefox18: --- → fixed
status-firefox19: --- → fixed
status-firefox20: --- → fixed
Comment on attachment 683854 [details] [diff] [review]
patch v2

Review of attachment 683854 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/activities/src/Activity.cpp
@@ +51,5 @@
>    NS_ENSURE_TRUE(window, NS_ERROR_UNEXPECTED);
>  
>    Init(window);
>  
> +  nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument());

window->GetExtantDoc()

@@ +55,5 @@
> +  nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument());
> +
> +  if (!nsEventStateManager::IsHandlingUserInput() &&
> +      !nsContentUtils::IsChromeDoc(document)) {
> +    printf_stderr("!! Can start activity from non user input or chrome code.");

NS_NAMED_LITERAL_STRING
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.