GithubHelp home page GithubHelp logo

wehriam / firefox-extensions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from muaz-khan/firefox-extensions

0.0 2.0 0.0 17 KB

Firefox extension API are used to enable screen capturing flag for specific domains, etc.

Home Page: https://www.webrtc-experiment.com/

JavaScript 100.00%

firefox-extensions's Introduction

Enable screen capturing in Firefox for both localhost/127.0.0.1 and https://www.webrtc-experiment.com pages.

Install from Firefox Addons Store

How to reuse same addon for your own domains?

Means that, you don't need to publish your own addon, you can reuse above link in your own domains/applications!

You should copy/paste following code in your own webpage/domain (HTML/PHP/Python/etc.):

// request addon to enable screen capturing for your domains
window.postMessage({
	enableScreenCapturing: true,
	domains: ["www.yourdomain.com", "yourdomain.com"]
}, "*");

// watch addon's response
// addon will return "enabledScreenCapturing=true" for success
// else "enabledScreenCapturing=false" for failure (i.e. user rejection)
window.addEventListener("message", function(event) {
	var addonMessage = event.data;

	if(!addonMessage || typeof addonMessage.enabledScreenCapturing === 'undefined') return;

    if(addonMessage.enabledScreenCapturing === true) {
    	// addonMessage.domains === [array-of-your-domains]
    	alert(JSON.stringify(addonMessage.domains) + ' are enabled for screen capturing.');
    }
    else {
    	// reason === 'user-rejected'
    	alert(addonMessage.reason);
    }
}, false);

Simplest Demo

Try this demo after installing above addon:

Wanna Deploy it Yourself?

  1. Open index.js
  2. Go to line 7
  3. Replace arrayOfMyOwnDomains array with your own list of domains
// replace your own domains with below array
var arrayOfMyOwnDomains = ['webrtc-experiment.com', 'www.webrtc-experiment.com', 'localhost', '127.0.0.1'];

How to Deploy?

  1. Signup here:
  1. Use unique-addon-name here:
  1. Add your own domains here:
  1. Make XPI of the directory.
[sudo] npm install jpm --global

jpm run -b nightly 		# test in Firefox Nightly without making the XPI

jpm xpi					# it will create xpi file
  1. Submit the XPI here:

Follow all steps. Read them carefully. This is hard/tough step to follow. Select valid browsers. E.g. Firefox 38 to Firefox 45. And submit your addon for "review".

It will take 2-3 hours for a Mozilla guy to review your addon. Then it will be available to public.

License

Firefox-Extensions are released under MIT licence . Copyright (c) Muaz Khan.

firefox-extensions's People

Contributors

julzvilla avatar muaz-khan avatar sschoorens 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.