GithubHelp home page GithubHelp logo

bobquest33 / multiple-service-workers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mobify/multiple-service-workers

0.0 2.0 0.0 21 KB

Experimenting with multiple service workers

License: MIT License

JavaScript 18.39% HTML 65.84% Python 15.77%

multiple-service-workers's Introduction

Multiple service worker tests

You can run a simple Node server if you're not testing push:

npm install
cd 
browserify common_worker.js > common_worker_browserified.js
./node_modules/.bin/http-server -c-1 test_site/

...or to test Push, get your GCM API key, and run the Python server:

npm install
browserify common_worker.js > common_worker_browserified.js
virtualenv venv
. venv/bin/activate
env GCM_API_KEY=<your api key> ./server.py

There are two pages. http://localhost:8080/ is the root, and http://localhost:8080/subpath/ is a second page. Both pages allow you to register and unregister a service worker, and test fetches and push messages.

To test the iframe communication

  1. Configure a proxy (e.g. Charles) to map https://test.com and http://test-insecure.com both to http://localhost:8080. Start the server.
  2. In Chrome or Firefox, load https://test.com. Make sure the JavaScript console is visible, and click register to register the service worker. Verify that it is handling fetch events by clicking fetch.
  3. Now load http://test-insecure.com. Click iframe to open an iframe to https://test.com. Click fetch in the iframe, and verify that the test.com service worker is intercepting fetches. Click check to verify that the service worker can check the permission and subscription.

multiple-service-workers's People

Contributors

benlast avatar

Watchers

 avatar  avatar

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.