├── LICENSE ├── README.md ├── app.js ├── extension ├── background.js ├── content-script.js ├── icon.png └── manifest.json ├── images ├── extensions.png └── preview.gif └── index.html /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Philipp Weissensteiner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Notes 2 | 3 | ### You might not need this anymore! 4 | 5 | Recent Chrome versions (70 and up) [introduced 6 | `getDisplayMedia`](https://groups.google.com/forum/?__s=seqnqtrfky2js3hsisxx#!msg/discuss-webrtc/Uf0SrR4uxzk/uO8sLrWuEAAJ) 7 | which essentially nullify this project and the need for an extension. You can 8 | simply acquire a screen stream with something like this: 9 | 10 | ```js 11 | navigator.mediaDevices.getDisplayMedia({ audio: false, video: true }) 12 | .then(stream => video.srcObject = stream) 13 | .catch(handleError); 14 | ``` 15 | 16 | A working demo can be found 17 | [here](https://cdn.rawgit.com/uysalere/js-demos/master/getdisplaymedia.html). 18 | 19 | 20 | *This project has been merged into https://github.com/GoogleChrome/webrtc in 21 | case something doesn't work have [a look over 22 | there.](https://github.com/webrtc/samples/tree/master/src/content/extensions/desktopcapture)* 23 | 24 | ## Introduction 25 | 26 | *This demo app shows you how to use a Chrome extension to access the 27 | `desktopCapture` API in your web-application.* 28 | 29 | (If you're writing a WebRTC app with screen sharing, and want to avoid sending 30 | users to `chrome://flags`) 31 | 32 | 33 | 34 | ## Index 35 | 36 | - [Setup](#setup) 37 | - [How does it work?](#how) 38 | - [Application (our web-app)](#app) 39 | - [Extension](#extension) 40 | - [Glueing it together](#glue) 41 | - [Avoiding a reload after installation](#reload) 42 | - [Credits](#credits) 43 | 44 | 45 | # Setup 46 | 47 | For the Demo to work, you will need to install the extension 48 | 49 | 1. Go to [chrome://extensions]() 50 | 2. Check "Developer mode" 51 | 3. Click "Load unpacked extension..." 52 | 4. In the dialog choose the `extension` folder from the repository 53 | 54 | You should see: 55 | 56 | NOTE: your ID will differ, that's fine though. 57 | 58 | 59 | # How does it work? 60 | 61 | 62 | ## Application (our web-app) 63 | 64 | The `index.html` file contains a "Share screen" button, an empty `