Closed
Bug 1279872
Opened 8 years ago
Closed 8 years ago
[WebExtensions] Allow acces to nsIDOMWindowUtils::isHandlingUserInput
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: kernp25, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0 Build ID: 20160612030220 Steps to reproduce: Allow webextensions to acces nsIDOMWindowUtils::isHandlingUserInput
OS: Unspecified → All
Hardware: Unspecified → All
Summary: nsIDOMWindowUtils::isHandlingUserInput → [WebExtensions] Allow acces to nsIDOMWindowUtils::isHandlingUserInput
Version: unspecified → Trunk
Comment 1•8 years ago
|
||
Can you be a bit clearer about what exactly you're looking for?
Comment 3•8 years ago
|
||
All that function does is tell internal code whether it's being called from an input event handler. It doesn't tell you anything you can't already find out for yourself.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
But, i need more code then (listeners etc. (more memory usage/high performance?)). Why i must put more code if the browser already does this? function UserInputEventMonitor() { // Records the time of the latest user input event. Workaround for determining whether play() calls are from the user or not var self = this; function input_callback(event) { self.last_event = performance.now(); }; function init_handlers() { for (event_type of ["keydown", "keyup", "mousedown", "mouseup", "touchstart", "touchend"]) { window.addEventListener(event_type, input_callback, true); }; }; init_handlers(); // In the case of running in an iframe: When the contents of the current iframe are set, event listeners are removed var document_observer = new MutationObserver(function(mutation_records) { init_handlers(); }); document_observer.observe(document, { childList: true }); self.reached_timeout = function() { return (performance.now() - self.last_event) < TIMEOUT; }; var TIMEOUT = 1500; // TODO: Make this configurable self.last_event = -2000; }; Why this extra more code, if the browser already tells u this?
Comment 5•8 years ago
|
||
The browser does it for a very specific, internal purpose. Adding a public API means designing, documenting, and maintaining that API, and maintaining a separate version of the same code when our internal logic needs to change. This is simple enough to implement on the client side (and the mutation observer is not necessary), so adding a new public API is not necessary.
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•