TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Cannot read clipboard from service worker in a MV3 chrome extension (2020)

65 pointsby fosefxover 2 years ago

10 comments

nightpoolover 2 years ago
I know there are a lot of valid complaints about Manifest v3, but I don&#x27;t understand this one. You&#x27;re telling me that browser extensions should be able to read and write to my clipboard silently at all times, with no user activation or notification? Honestly, that&#x27;s kind of horrifying, and I&#x27;m shocked to hear it existed on v2 extensions. It sounds like a great way to build a keylogger for user passwords.<p>What are some valid usecases for this permission? I guess &quot;syncing clipboards between two operating systems&quot; is one of them? But why build that as a browser extension? It seems like the wrong tool for the job.
评论 #32623853 未加载
评论 #32623707 未加载
评论 #32623893 未加载
评论 #32623648 未加载
评论 #32623646 未加载
评论 #32623900 未加载
评论 #32623658 未加载
评论 #32623990 未加载
评论 #32623662 未加载
madeofpalkover 2 years ago
I think Chrome&#x27;s reasoning for this is completely fair:<p>&gt; <i>navigator.clipboard is only intended to be used in a focused document, which is not possible for service workers. Therefore, I don&#x27;t anticipate any intended support for navigator.clipboard.read on service workers</i><p>I don&#x27;t think a browser extension, which I personally consider it sit in between &quot;native app&quot; and &quot;website&quot; in terms of privilege hierarchy, should be able to arbitrarily read the operating system clipboard silently in the background.
评论 #32623559 未加载
评论 #32623518 未加载
gnicholasover 2 years ago
Does any one have a sense of the likelihood that Google extends the original timeline for this changeover? How can you force everyone to update their software (in some cases overhaul) to a new system that isn&#x27;t fully built yet?<p>My company has two Chrome extensions, one of which is partly updated, and the other of which we haven&#x27;t started yet. We have no idea what we&#x27;ll discover when we begin the process of updating the second one, and we&#x27;ve been burned by Google&#x27;s &#x27;upgrades&#x27; in the past (Google Docs canvas-based rendering comes to mind). The worst-case scenario is that it is either impossible to migrate, or that it would cost so much that it would wipe out years of revenue.<p>I&#x27;ve talked with others in the accessibility space, and they are concerned about how this forced migration will impact the market for &#x27;niche&#x27; tools like accessibility extensions. They may simply cease to exist. Hopefully Brave or other Chromium browsers will continue to allow legacy extensions.
评论 #32623421 未加载
评论 #32623404 未加载
评论 #32623757 未加载
encryptluks2over 2 years ago
If I&#x27;m reading this correctly, extension developers want a way to read the user clipboard with a separate permission dialog than having to also request the ability to inject scripts into pages? If that is the case I can partially see why this is the way it is. The clipboard reading permission is part of the privacy controls built into the browser. So with page injection, the extension would have to request permission for sites that it wants to read the clipboard from. Otherwise, a separate dialog would give unhindered access to read from the clipboard. Am I understanding that correctly?
评论 #32623431 未加载
joecotover 2 years ago
My company had a chrome extension they used for making twilio phone calls. V3&#x27;s service worker focus made that a complete nonstarter. Ended up writing a thing to make phone calls in a background tab, use the Broadcast channel Api to communicate between the background tab and the active tab, and wrote instructions on the background tab for allowing sound permissions explicitly. The plus side is that we likely won&#x27;t be dependent on chrome anymore, but I expect I&#x27;m not at the only company who got a rude awakening from the v3 transition. And yes, you can use v2 extensions with chrome enterprise, which I have no interest in doing.
dotprotoover 2 years ago
Hi, Simeon from the Chrome Extensions team here. Clipboard access is one of the browser capabilities that currently requires a document to use. We&#x27;re planning to address this use case (and others that require DOM) by introducing a new capability called offscreen documents[1].<p>In short, an offscreen document is a temporary headless page that is instantiated for a given reason that requires DOM access. It <i>is not</i> meant as a long-lived background context.<p>[1]: <a href="https:&#x2F;&#x2F;bugs.chromium.org&#x2F;p&#x2F;chromium&#x2F;issues&#x2F;detail?id=1339382" rel="nofollow">https:&#x2F;&#x2F;bugs.chromium.org&#x2F;p&#x2F;chromium&#x2F;issues&#x2F;detail?id=133938...</a>
zzo38computerover 2 years ago
What I think is that what should be needing for browser extensions is to be able to write extensions in C, and available only for manual install by advanced users (so that it is not available to the official catalog of extensions).<p>However, additional capabilities to interact with the browser are also needed, including to implement new and intercept existing: protocols, MIME types, character encodings, HTML commands, CSS commands, JavaScripts in web pages (and the API they have access to), ARIA, menus, user interface elements, etc. (I think things will need to be rewritten to make this work efficiently, including moving many features to extensions which are then included by default, instead of being core features.)<p>Making C APIs for purposes would be helpful, although even if the existing API are with JavaScripts, JavaScript functions can be accessed by C codes by implementing N-API, I suppose.
hombre_fatalover 2 years ago
&gt; Thanks for the issue....<p>&gt; Thanks.....<p>Aside: Do people know that trailing &quot;...&quot; tends to communicate annoyance or sarcasm? I think the people writing it think it means something else, like some sort of intermission before the next thing they write, but I wouldn&#x27;t include it in professional comms at all.
评论 #32623588 未加载
评论 #32623761 未加载
评论 #32623676 未加载
评论 #32623560 未加载
评论 #32623688 未加载
评论 #32623556 未加载
cobertosover 2 years ago
This bug hasn&#x27;t received a comment from another @chromium.org in &gt;1 yr. Feels like so many of Google&#x27;s bugs related to functionality many users relied on
aehardingover 2 years ago
It&#x27;s extremely frustrating how some chrome extension apis such as chrome.tabCapture simply are no longer background context compatible, since they aren&#x27;t in service workers. And they&#x27;re just completely silent, don&#x27;t even acknowledge the shortcomings. Just a hugely frustrating developer experience. Shame on Google, and this whole MV3 fiasco has permanently soured my view on Chrome developer Relations.
评论 #32623829 未加载