Closed
Bug 963366
Opened 10 years ago
Closed 9 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)
940 bytes,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
2.13 KB,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
1.06 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
6.83 KB,
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•10 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → kchen
Flags: needinfo?(kchen)
Comment 1•9 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•9 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•9 years ago
|
||
Attachment #8373146 -
Flags: review?(ehsan)
Assignee | ||
Comment 4•9 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•9 years ago
|
||
An update to test_interfaces.html (and a review from a DOM peer) would be needed.
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8373200 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 7•9 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=00a79b2ed68b
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 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•9 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•9 years ago
|
||
Also, can you please add a test which makes sure that navigator.requestWakeLock is unavailable in non-gonk platforms?
Assignee | ||
Comment 12•9 years ago
|
||
Attachment #8373146 -
Attachment is obsolete: true
Attachment #8373823 -
Flags: review+
![]() |
||
Comment 13•9 years ago
|
||
Comment on attachment 8373200 [details] [diff] [review] Update test_interfaces.html r=me
Attachment #8373200 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 14•9 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/86321b26161d https://hg.mozilla.org/integration/b2g-inbound/rev/0af4a28621f7 https://hg.mozilla.org/integration/b2g-inbound/rev/b183597c0190 https://hg.mozilla.org/integration/b2g-inbound/rev/e0632c6aca0b
Comment 15•9 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•9 years ago
|
||
re-land: https://hg.mozilla.org/integration/b2g-inbound/rev/3e66c5777cfe https://hg.mozilla.org/integration/b2g-inbound/rev/c8655cd53cc1 https://hg.mozilla.org/integration/b2g-inbound/rev/d8c04dbd4886 https://hg.mozilla.org/integration/b2g-inbound/rev/5b263d1c94d7
Comment 17•9 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: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Updated•4 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•