Last Comment Bug 699459 - Add a pref to disable Battery API
: Add a pref to disable Battery API
Status: RESOLVED FIXED
: user-doc-needed
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla10
Assigned To: Mounir Lamouri (:mounir)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: 678694
  Show dependency treegraph
 
Reported: 2011-11-03 10:26 PDT by Mounir Lamouri (:mounir)
Modified: 2011-11-11 18:47 PST (History)
5 users (show)
mounir: in‑testsuite?
mounir: in‑litmus?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (3.92 KB, patch)
2011-11-03 15:49 PDT, Mounir Lamouri (:mounir)
jonas: review+
Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2011-11-03 10:26:12 PDT
Something like "dom.battery.enabled". true by default but can be turned false. In that case, I don't know if navigator.mozBattery should return null or if we should return the default values. I'm worried returning null might break some websites.
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2011-11-03 10:35:30 PDT
Or not be exposed at all?
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-11-03 10:35:51 PDT
The property shouldn't be defined at all.  That's what we do for other preffable DOM features.

See nsIDOMStorageIndexedDB.
Comment 3 Mounir Lamouri (:mounir) 2011-11-03 10:45:40 PDT
That would be better indeed but that would make changing the pref during run time useless, right? Seems a fair trade though.
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2011-11-03 11:03:05 PDT
> That would be better indeed but that would make changing the pref during run time
> useless, 

Depends on how we implement.  If we look at the pref during prototype setup, then flipping the pref and reloading the page would work.  If we only look at it during the classinfo initialization stuff then flipping it would need a browser restart, yes.
Comment 5 Mounir Lamouri (:mounir) 2011-11-03 15:49:39 PDT
Created attachment 571817 [details] [diff] [review]
Patch v1
Comment 6 Mounir Lamouri (:mounir) 2011-11-03 15:52:03 PDT
We should probably push this before the Aurora uplift (the 8th). Worst case, we could directly push it to Aurora but better to prevent this.
Comment 7 Ed Morley [:emorley] 2011-11-04 03:09:37 PDT
https://hg.mozilla.org/mozilla-central/rev/ae94f0235649

Note You need to log in before you can comment on or make changes to this bug.