TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Service Workers: an Introduction

126 点作者 mnazim超过 8 年前

10 条评论

Animats超过 8 年前
W3C: &quot;Service workers create the opportunity for a bad actor to turn a bad day into a bad eternity.&quot;[1] With service workers, cross-site scripting vulnerabilities are forever.<p>Service workers install by drive-by, which is troubling. In Firefox, check &quot;about:serviceworkers&quot; to see what you have installed. Take a look. You probably have far more service workers active than you thought. There are supposed to be enough cross-site scripting restrictions to keep service workers contained to their origin domain, but some holes have been found. There was a successful service worker attack on Dropbox, since fixed. &quot;If you run a site that serves user files with secret URLs from a shared domain, you need to look out for the Service-Worker: script HTTP header; if you see it, run for the hills.&quot;[2]<p>If an attacker can get one page loaded from a site being attacked, they then own all traffic between the user and the site. This has lots of attack potential.<p>[1] <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;service-workers&#x2F;#security-considerations" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;service-workers&#x2F;#security-consideratio...</a> [2] <a href="https:&#x2F;&#x2F;alf.nu&#x2F;ServiceWorker" rel="nofollow">https:&#x2F;&#x2F;alf.nu&#x2F;ServiceWorker</a>
评论 #12946358 未加载
gfaure超过 8 年前
Chrome also has chrome:&#x2F;&#x2F;serviceworker-internals.<p>I have no idea why Hampton Farms saw it fit to install a service worker. Furthermore, this isn&#x27;t gated by a permission dialog like location services or plugin access?
评论 #12946833 未加载
SimeVidas超过 8 年前
Note that this is the low-level API. For most people, I think, the recommended approach is to use libraries instead. Google itself has released sw-toolbox and sw-precache. There’s also a web-push server module for push messages.
throwaway98237超过 8 年前
You gotta see the humor in Google being of the opinion that a &quot;service worker is a script&quot;. I mean, we&#x27;ve all kinda expected that Larry Page is under the assumption that we&#x27;re all just subroutines running in his &quot;matrix&quot;, but now it&#x27;s official.
评论 #12945463 未加载
jonaf超过 8 年前
This seems like a security nightmare. I sincerely hope there&#x27;s a way to just turn off &quot;offline experience&quot; in Chrome before service workers become widespread. The browser is a dangerous place to execute software. I suppose native apps can be just as insecure, but I worry about an ecosystem with many neighbors (web apps, extensions, plugins, add-ons, etc) running in the same process. It&#x27;s much more likely one web app can steal my passwords from LastPass, for example, without knowing it. The chain of vectors just feels really dangerous.
评论 #12944203 未加载
评论 #12946840 未加载
评论 #12946204 未加载
评论 #12945220 未加载
评论 #12946576 未加载
cproctor超过 8 年前
Oops. I thought this might be an attempt at rapprochement with their janitorial staffs. Perhaps the wrong nomenclature for our new era.
Eun超过 8 年前
Regarding HTTPs: there is <a href="https:&#x2F;&#x2F;test.bi" rel="nofollow">https:&#x2F;&#x2F;test.bi</a>
评论 #12947474 未加载
crudbug超过 8 年前
I haven&#x27;t read the specs, can you spawn multiple service workers on a single page ?<p>If yes, what are the security measures to stop a rogue site to blow up your browser ?
评论 #12944495 未加载
voltagex_超过 8 年前
How can I protect my browser against these things?
z3t4超过 8 年前
this seems unnecessary as you need a html file and browser to bootstrap anyway. There is more to it though, it can continue to run after the browser has exited and intercept push mesages.