Git Product home page Git Product logo

google / service-worker-detector Goto Github PK

View Code? Open in Web Editor NEW
165.0 9.0 32.0 3.17 MB

This extension detects if a website registers a Service Worker.

Home Page: https://chrome.google.com/webstore/detail/service-worker-detector/ofdigdofloanabjcaijfidkogmejlmjc

License: Apache License 2.0

JavaScript 94.62% CSS 3.98% HTML 1.39%
service-worker service-workers serviceworker manifest web-app-manifest browser-extension progressive-web-app pwa progressive-web-apps cache-storage

service-worker-detector's Introduction

👷‍♀️ 👷 Service Worker Detector

💻 💬 Description

This extension detects if a website registers a Service Worker by reading the navigator.serviceWorker.controller property. This read-only property of the ServiceWorkerContainer interface only returns a ServiceWorker object if its state is activated. It returns null if the request is a force refresh (shift + refresh) or if there is no active worker.

⚠️ If the extension does not seem to work, perform a soft reload, so the Service Worker has a chance to become active.

This is not an officially supported Google product.

🖥 🔫 Screenshots

Screenshot Service Worker

Screenshot Manifest

Screenshot Cache Storage

🔧 🛍 Installation

Install the Service Worker Detector extension for your favorite browser:

⚤ 👍 Diversity in Tech

The extension represents Service Workers with construction worker emoji. The extension icon randomly features the female or the male construction worker.

📄 💼 License

Copyright 2017 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

service-worker-detector's People

Contributors

dependabot[bot] avatar tomayac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

service-worker-detector's Issues

[Firefox] does not work on YouTube

In Firefox beta 71, because of some Firefox quirk(?), as commented in source:

// ⚠️ TODO: Why does Firefox require option.toProxyScript?

Error: "Unexpected property toProxyScript"
moz-extension://2df93d6f-ffc3-4d19-8240-a4fd87b6ade2/contentscript.js:153
contentscript.js:161:15

Works fine in current Fx stable release.

Doesn't detect on Outlook?

outlook.live.com/mail uses a ServiceWorker (as seen in the DevTools Application tab) but doesn't light up the detector icon?

[feature request] simple ALERT script

Hi Thomas @tomayac 👋 . I wanted to ask if it's not too much trouble to make some very simple script.
To check if the current page i'm on registered any service workers and send a alert(..... with some message and preferably
the URL from the scope (the one on the top) and notify if it did. Something like:
alert('The website registered Service Worker'+'/n'+**scope...**);
It would help me alot on my end and turns out that Java Scripting is not my jam(i tried).
I very much hoping here that you'll have the time and willingness. Thank you up front for concidering 👍

requires rosetta

Would be nice is this is not required now that we are 2 years into Macs with arms chips.

Is an arm build of the Safari Extension needed or is there a different blocker ?

Screenshot 2023-09-21 at 07 58 26

Use screenshots of Firefox, not of Chrome, at addons.mozilla.org (AMO)

From https://addons.mozilla.org/addon/service-worker-detector/, updated 2018-04-20:

image

image

Shots of the extension in its various states – in a Firefox window, with the page action menu dropped down, where appropriate – will help new users to know what to expect; the scope of the extension.

Ideally, one of the shots should zoom in on the page action icon in its non-clicked state. So that (lazy) readers don't have to click the shot to appreciate the detail.

Thanks :-)

Allow users (of Waterfox) to be aware of a registration before the Service Worker becomes active

Enhancement request

Please, would you consider adding a user preference that allows an icon of Service Worker Detector to be seen whilst a worker is inactive?

I reckon, there need not be a GUI to the preference. A boolean in about:config might suffice.

I can encourage someone in or around the Waterfox project to make a pull request. (I'd do so myself, but I don't have coding skills.)

Background

Firefox Quantum benefits from its page actions menu, where Service Worker Detector can present itself whilst a worker is inactive.

Waterfox 56.2.0 does not have that benefit.

Perspectives

https://www.reddit.com/comments/8hz93r/-/dyoabtb/ draws attention to the progressive, pro-Photon viewpoint of Waterfox project leader Alex Kontos – I assume that there'll be the page actions menu, and other things that are associated with Photon, in due course.

Somewhere between acceptance of service workers (my viewpoint) and blanket refusal (dom.serviceWorkers.enabled false and so on), there's a subset of users where interest in service workers overlaps with caution and sometimes, scepticism. Some people in this subset will appreciate a visual hint, from Service Worker Detector, that there's a registration.

[Firefox] does not work on twitter

Because of Firefox CSP issue. You are trying to inject inline script and Twitter blocks them.

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). contentscript.js:50:20

Document non-appearance of the icon

#7 (comment) for example and more recently, https://addons.mozilla.org/addon/service-worker-detector/reviews/1161836/:

… Just installed this addon but it did not detect that Youtube installed a service worker. …

#9 (comment):

… the extension only triggers when navigator.serviceWorker.controller is no longer null, i.e., as soon as the service worker becomes active (documentation).

Suggestions

Update https://github.com/google/service-worker-detector/blob/master/README.md with a short simple explanation of why the icon does not appear in some situations. The opening paragraph is probably ideal, a handful of bullet points should suffice.

Add About this extension information to https://addons.mozilla.org/addon/service-worker-detector/ – include a link to README.md but people love to not follow links to documentation ;-/ so FWIW I reckon it's worth including a brief explanation, re: non-appearance of the icon, at the AMO page itself.


AFAICT (from The Air Horner example):

  • expect no Service Worker Detector icon after the initial load of a page
  • expect the icon to appear after a simple reload; if a tab is closed then reopened; if a tab is loaded after restoring a session.

From some of the earlier issues I gather that in some cases, a first simple reload might not suffice, two reloads are necessary. True?

In some cases the worker will be active following a hard refresh e.g. Shift-reload or Control-F5. This seems to be true for The Air Horner.

In other cases the worker will not be active following a hard refresh. This seems to be true for the current worker for Gmail – scope https://mail.google.com/mail/u/0/

Side note

Mozilla bug 1495275 - Corrupted Content Error for gmail (I'm using Service Worker Detector, with Waterfox, in connection with this bug).

No indication of registration of a worker on Waterfox 56.2.0 or Firefox 60.0.1

No Indicator on Firefox · Issue #8 · google/service-worker-detector was closed as not reproducible.

I do not get a construction worker icon to appear, when expected, in the address field address bar in either of the following on FreeBSD-CURRENT:

  • Waterfox 56.2.0.7 (56.2.0 build 20180515213058)
  • Firefox 60.0.1,1 (60.0.1).

With Twitter as an example:

  1. launch the browser
  2. refrain from opening any tab to Twitter
  3. about:serviceworkers
  4. find and un-register the worker for https://twitter.com/
  5. in a separate tab, visit https://twitter.com/ – load the page completely at least once, maybe reload
  6. bring about:serviceworkers to front, reload the page, find the newly registered worker for Twitter
  7. bring the Twitter tab to front, reload

In Waterfox

No icon in the address bar. At first I suspected an extension conflict, but then I found …

In Firefox

2018-05-20 18 18 39

🛏 ❌ 👷 No active Service Worker found.

Soft reloads do not cause an icon to appear in the bar.

Should a notification of some sort – at least, appearance of the page action icon in the address bar – occur when registration/installation is detected on Firefox? From the description, I assume so:

… detects if a website registers a Service Worker …

– and both screenshots (of Chrome, at addons.mozilla.org) include the construction worker icon, with the first shot showing:

Events

☐ activate
☐ fetch
☑ install

No Indicator on Firefox

On Firefox no indicator/app icon is added to the toolbar. Also there isn't one added to the "customize" menu so you can't even add it later.
Not sure if this is directly an issue of the extension or firefox not completely copying chrome...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.