Closed Bug 798298 Opened 8 years ago Closed 8 years ago
Allow chrome JS code to know if it is being called as a result of a user input event
Currently, there are two ways to make sure some features are called when there is a real user action that might have requested it: - the popup manager (in nsPIDOMWindow and nsGlobalWindow); - nsEventStateManager::IsHandlingUserInput(). None of them (AFAIK) are available to JS but bug 794407 and bug 769569 needs a mechanism or the other to make sure those features are not abused. I think we should expose something trough a component.
Comment on attachment 668475 [details] [diff] [review] Patch >+ *aHandlingUserInput = GetPresContext()->EventStateManager()->IsHandlingUserInput(); GetPresContext() needs null check. >+ /** >+ * Returns if the current code is runned from a user input handling. returns what? And 'is run' But perhaps: Returns true if user input is being handled. >+ * >+ * This is calling nsEventStateManager::IsHandlingUserInput(). This calls nsEventStateManager::IsHandlingUserInput() >+ */ >+ readonly attribute boolean handlingUserInput; isHandlingUserInput
Attachment #668475 - Flags: review?(bugs) → review+
Target Milestone: --- → mozilla19
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Couldn't the homescreen app simply not display itself? I.e. it's the homescreen app which is listing all the apps, it can simply choose to not skip displaying anything when it sees its own manifestURL
Jonas, I guess you meant to comment in bug 794407.
Pushed in mozilla-aurora, because it is blocking basecamp. https://hg.mozilla.org/releases/mozilla-aurora/rev/cc22c3a6f9ed
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.