Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make screensharing extension integration customizable #230

Open
zdila opened this issue Oct 16, 2016 · 3 comments
Open

Make screensharing extension integration customizable #230

zdila opened this issue Oct 16, 2016 · 3 comments

Comments

@zdila
Copy link

zdila commented Oct 16, 2016

In our application we use our custom Chrome extension to provide screensharing. Now we must patch adapterjs sources to not to use universal iframe with detectRTC.html. Would you accept a pull request which would make it configurable?

@johache
Copy link
Contributor

johache commented Oct 17, 2016

That shouldn't be an issue.
You may add links to the Chrome/FF extension in source/pluginInfo.js, and use them in source/adapter.screensharing.js.
After that, you should be able to easily override the content of the dictionary by defining it before requiring AJS
(eventually we might move to a config step, but not right now)

@zdila
Copy link
Author

zdila commented Oct 17, 2016

Thanks for mentioning pluginInfo.

Still in our case we use no iframe and logic simillar to detectRTC.html is directly in our main JS.

Currently we use following regexps to patch AdapterJS code on Webpack build:

// see https://github.com/Temasys/AdapterJS/issues/230
        replace: /\{\s*var iframe\s*=\s*document\.createElement\(/,
        with: '{return;var iframe=document.createElement('

        replace: /(var )?postFrameMessage/,
        with: 'window.postFrameMessage'

        replace: /(var |,)onIFrameCallback\s*=/,
        with: ';window.onIFrameCallback='

        replace: /\bmessage\b/g,
        with: 'xxxx_message'

        replace: 'https://addons.mozilla.org/en-US/firefox/addon/skylink-webrtc-tools/',
        with: 'https://addons.mozilla.org/en-GB/firefox/addon/someapp-screen-sharing/'

// see https://github.com/Temasys/AdapterJS/issues/228
        replace: '"PermissionDeniedError", "SecurityError"|\'PermissionDeniedError\',\'SecurityError\'',
        with: '"NotAllowedError"'

// see https://github.com/Temasys/AdapterJS/issues/229
        replace: 'http:\/\/',
        with: `https://`

@simonemazzoni
Copy link

simonemazzoni commented Jun 15, 2018

Hello, I think this issue is still present!
I'm trying to use my custom extension (which is similar to the official Skylink one) but I got errors in Chrome because even if I replace extensionInfo.chrome.iframeLink param with the address of my detectRTC.html version, the iframe is appended before the redefinition of the variable and so https://cdn.temasys.com.sg/skylink/extensions/detectRTC.html is still loaded as iframeLink, but that page contains the extensionId of the skylink extension, and nothing works.

i guess it would be useful to have a sort of init method where to possibly specify custom configurations, or a method to update such configurations.

Notice that I am using adapter.screenshare.min.js from NPM imported as ES6 module in my app code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants