--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/252ffcbd-5692-46fc-a7a8-58e759b3e306n%40chromium.org.
Yes, chrome.debugger API seems to be the only thing that is capable of emitting isTrusted=true events but it's designed to be used in conjunction with, well, debugging. It creates a debugging session, halts client JS execution, etc. All this is highly undesirable (totally unrelated) when the extension merely promises to give a user an alternative input source to control the browser.
Just double checked. All mouse/keyboard events created via chrome.scripting.executeScript also end up being isTrusted=false. The issue in a nutshell is that since all mouseover/mouseout/etc. events produced from extension scripts are inevitably isTrusted=false a sizeable bulk of extensions that focus on alternative input source and/or user<->browser iteration automation become almost unfeasible to develop.
Again, I totally support the fact that script-produced events are isTrusted=false since it helps a lot with preventing user control highjacking malware. My point is that within the framework of chrome extensions thata) are being reviewed before publishingb) already allow access/control of way more "intimate" things through MV3 permission systemthere should be a way to emit trusted events (other than for debugging).
This seems like a good suggestion. I'd even go as far as to suggest that all events from extension content scripts should be trusted. The entire concept of extensions is based on the assumption that they are trusted. An evil content script can already do arbitrary script injection, keylogging, etc. This suggestion makes extensions more powerful without meaningfully impacting security.
My needs? No, I'm not. I have no need for this change. I'm thinking of the needs of other people.It's not really so clear cut. I don't see why a content script shouldn't be considered part of the user agent. The user agent is the browser and a browser extension is an extension of this user agent. To my knowledge the DOM spec doesn't address browser extensions directly - it makes a distinction between user agent and application. It surely makes more sense to consider an extension to be part of the user agent than part of the application.Then again, the spec does state that dispatchEvent sets isTrusted = false, so you're right. Maybe an API function for content scripts to dispatch trusted events would be the best solution.