Closed
Bug 963366
Opened 11 years ago
Closed 11 years ago
Hide navigator.requestWakeLock and MozWakeLock from the web except on Firefox OS
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: ehsan.akhgari, Assigned: kanru)
References
Details
(Keywords: dev-doc-complete)
Attachments
(4 files, 1 obsolete file)
(deleted),
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
kanru
:
review+
|
Details | Diff | Splinter Review |
navigator.requestWakeLock and MozWakeLock only do something useful in Firefox OS, but they are currently exposed to all platforms unconditionally. The WebIDL has a [Func="Navigator::HasWakeLockSupport"] attribute which may trick people into believing that these names are not exposed in some places but that function only makes sure that it can instantiate the nsIPowerManagerService service, which is available everywhere.
Kan-ru, is there any reason why we should not do this? If not, are you interested in taking this bug?
Thanks!
Flags: needinfo?(kchen)
Reporter | ||
Updated•11 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → kchen
Flags: needinfo?(kchen)
Comment 1•11 years ago
|
||
We'll want this soonish, to prevent web pages from having the ability to prevent the screen saver from turning on in non-B2G builds.
Assignee | ||
Comment 2•11 years ago
|
||
mochitest-browser test can't use SpecialPowers.pushPermissions without this fix.
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/dom/power/test/browser_wakelocks.js | leaked window property: lastPermission
Attachment #8373145 -
Flags: review?(jmaher)
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8373146 -
Flags: review?(ehsan)
Assignee | ||
Comment 4•11 years ago
|
||
Was disabled entirely in bug 843893. I think we should at least run a subset of these tests.
Attachment #8373147 -
Flags: review?(jgriffin)
Comment 5•11 years ago
|
||
An update to test_interfaces.html (and a review from a DOM peer) would be needed.
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #8373200 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Comment on attachment 8373145 [details] [diff] [review]
Fix leaked lastPermission var
Review of attachment 8373145 [details] [diff] [review]:
-----------------------------------------------------------------
thanks!
Attachment #8373145 -
Flags: review?(jmaher) → review+
Comment 9•11 years ago
|
||
Comment on attachment 8373147 [details] [diff] [review]
Re-enable basic power & wakelock tests for desktop
Review of attachment 8373147 [details] [diff] [review]:
-----------------------------------------------------------------
thanks for cleaning up the moz.build rules and making the mochitest.ini more complete!
Attachment #8373147 -
Flags: review?(jgriffin) → review+
Reporter | ||
Comment 10•11 years ago
|
||
Comment on attachment 8373146 [details] [diff] [review]
Hide navigator.requestWakeLock behind pref dom.wakelock.enabled
Review of attachment 8373146 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for fixing this! r=me with the below addressed.
::: dom/base/Navigator.cpp
@@ +1685,5 @@
> Navigator::HasWakeLockSupport(JSContext* /* unused*/, JSObject* /*unused */)
> {
> + // First of all, the general pref has to be turned on.
> + bool enabled = false;
> + Preferences::GetBool("dom.wakelock.enabled", &enabled);
Please use a [Pref] attribute in the webidl instead.
Attachment #8373146 -
Flags: review?(ehsan) → review+
Reporter | ||
Comment 11•11 years ago
|
||
Also, can you please add a test which makes sure that navigator.requestWakeLock is unavailable in non-gonk platforms?
Assignee | ||
Comment 12•11 years ago
|
||
Attachment #8373146 -
Attachment is obsolete: true
Attachment #8373823 -
Flags: review+
Comment 13•11 years ago
|
||
Comment on attachment 8373200 [details] [diff] [review]
Update test_interfaces.html
r=me
Attachment #8373200 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 14•11 years ago
|
||
Comment 15•11 years ago
|
||
Backed out for desktop B2G mochitest failures.
https://hg.mozilla.org/integration/b2g-inbound/rev/59af72902abf
https://tbpl.mozilla.org/php/getParsedLog.php?id=34479898&tree=B2g-Inbound
Assignee | ||
Comment 16•11 years ago
|
||
Comment 17•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3e66c5777cfe
https://hg.mozilla.org/mozilla-central/rev/c8655cd53cc1
https://hg.mozilla.org/mozilla-central/rev/d8c04dbd4886
https://hg.mozilla.org/mozilla-central/rev/5b263d1c94d7
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Comment 18•11 years ago
|
||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•