├── docs ├── README.md ├── stashed-ports.md └── api-idea.md ├── tidyconf.txt ├── tests ├── resources │ ├── empty-worker.js │ ├── accepting-worker.js │ ├── rejecting-worker.js │ ├── echo-worker.js │ ├── testharnessreport.js │ ├── service-worker-loader.html │ ├── testharness.css │ ├── test-helpers.js │ ├── connect.js │ ├── testharness-helpers.js │ ├── service-worker-test-helpers.js │ └── testharness.js ├── connect.html └── connect-cross-origin.html ├── README.md ├── polyfill ├── client-polyfill.js └── service-polyfill.js ├── design-alternatives.md ├── explainer.md ├── LICENSE ├── use-cases.html └── index.html /docs/README.md: -------------------------------------------------------------------------------- 1 | Various documents with ideas for navigator.connect related APIs. 2 | -------------------------------------------------------------------------------- /tidyconf.txt: -------------------------------------------------------------------------------- 1 | char-encoding: utf8 2 | indent: yes 3 | wrap: 100 4 | tidy-mark: no 5 | -------------------------------------------------------------------------------- /tests/resources/empty-worker.js: -------------------------------------------------------------------------------- 1 | importScripts('../../polyfill/service-polyfill.js'); 2 | // Do nothing. 3 | -------------------------------------------------------------------------------- /tests/resources/accepting-worker.js: -------------------------------------------------------------------------------- 1 | importScripts('../../polyfill/service-polyfill.js'); 2 | 3 | self.addEventListener('crossoriginconnect', function(event) { 4 | event.acceptConnection(true); 5 | }); 6 | -------------------------------------------------------------------------------- /tests/resources/rejecting-worker.js: -------------------------------------------------------------------------------- 1 | importScripts('../../polyfill/service-polyfill.js'); 2 | 3 | self.addEventListener('crossoriginconnect', function(event) { 4 | event.acceptConnection(false); 5 | }); 6 | -------------------------------------------------------------------------------- /tests/resources/echo-worker.js: -------------------------------------------------------------------------------- 1 | importScripts('../../polyfill/service-polyfill.js'); 2 | 3 | self.addEventListener('crossoriginconnect', function(event) { 4 | event.acceptConnection(true); 5 | }); 6 | 7 | 8 | self.addEventListener('crossoriginmessage', function(event) { 9 | event.source.postMessage(event.data, event.ports); 10 | }); 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | navigator.connect 2 | ================= 3 | 4 | Making direct connections between cross-origin Javascript contexts. 5 | 6 | Documents in this repository 7 | ---------------------------- 8 | 9 | * [Use Cases and Security Requirements](https://mkruisselbrink.github.io/navigator-connect/use-cases.html) 10 | * [Explainer](explainer.md) 11 | * [Specification](https://mkruisselbrink.github.io/navigator-connect/) 12 | 13 | Communication 14 | ------------- 15 | 16 | * [Github Issue Tracker](https://github.com/mkruisselbrink/navigator-connect/issues) 17 | -------------------------------------------------------------------------------- /tests/resources/testharnessreport.js: -------------------------------------------------------------------------------- 1 | /* 2 | * THIS FILE INTENTIONALLY LEFT BLANK 3 | * 4 | * More specifically, this file is intended for vendors to implement 5 | * code needed to integrate testharness.js tests with their own test systems. 6 | * 7 | * Typically such integration will attach callbacks when each test is 8 | * has run, using add_result_callback(callback(test)), or when the whole test file has 9 | * completed, using add_completion_callback(callback(tests, harness_status)). 10 | * 11 | * For more documentation about the callback functions and the 12 | * parameters they are called with see testharness.js 13 | */ 14 | -------------------------------------------------------------------------------- /tests/connect.html: -------------------------------------------------------------------------------- 1 | 2 |