Skip to content

Commit 7899611

Browse files
committed
Drop (old) Edge support
The new Edge is based in Chromium and the Chrome shim is used.
1 parent a44f23a commit 7899611

16 files changed

+5
-430
lines changed

Gruntfile.js

-26
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,6 @@ module.exports = function(grunt) {
3333
adapterAndNoGlobalObject: {
3434
src: ['./dist/adapter_core5.js'],
3535
dest: './out/adapter_no_global.js'
36-
},
37-
// Use this if you do not want Microsoft Edge shim to be included.
38-
adapterNoEdge: {
39-
src: ['./dist/adapter_core5.js'],
40-
dest: './out/adapter_no_edge.js',
41-
options: {
42-
// These files will be skipped.
43-
ignore: [
44-
'./dist/edge/edge_shim.js'
45-
],
46-
browserifyOptions: {
47-
// Exposes the shim in a global object to the browser.
48-
standalone: 'adapter'
49-
}
50-
}
51-
},
52-
// Use this if you do not want Microsoft Edge shim to be included and
53-
// do not want adapter to expose anything to the global scope.
54-
adapterNoEdgeAndNoGlobalObject: {
55-
src: ['./dist/adapter_core5.js'],
56-
dest: './out/adapter_no_edge_no_global.js',
57-
options: {
58-
ignore: [
59-
'./dist/edge/edge_shim.js'
60-
]
61-
}
6236
}
6337
},
6438
eslint: {

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ You will find `adapter.js` in `bower_components/webrtc-adapter/`.
4848
##### NPM
4949
In node_modules/webrtc-adapter/out/ folder you will find 4 files:
5050
* `adapter.js` - includes all the shims and is visible in the browser under the global `adapter` object (window.adapter).
51-
* `adapter_no_edge.js` - same as above but does not include the Microsoft Edge (ORTC) shim.
52-
* `adapter_no_edge_no_global.js` - same as above but is not exposed/visible in the browser (you cannot call/interact with the shims in the browser).
5351
* `adapter_no_global.js` - same as `adapter.js` but is not exposed/visible in the browser (you cannot call/interact with the shims in the browser).
5452

5553
Include the file that suits your need in your project.

index.d.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ declare module "webrtc-adapter" {
2525
fixNegotiationNeeded(window: Window): void;
2626
}
2727

28-
interface IEdgeShim {
29-
shimPeerConnection(window: Window): void;
30-
shimReplaceTrack(window: Window): void;
31-
}
32-
3328
interface IFirefoxShim {
3429
shimOnTrack(window: Window): void;
3530
shimPeerConnection(window: Window): void;
@@ -53,7 +48,7 @@ declare module "webrtc-adapter" {
5348
export interface IAdapter {
5449
browserDetails: IBrowserDetails;
5550
commonShim: ICommonShim;
56-
browserShim: IChromeShim | IEdgeShim | IFirefoxShim | ISafariShim | undefined;
51+
browserShim: IChromeShim | IFirefoxShim | ISafariShim | undefined;
5752
extractVersion(uastring: string, expr: string, pos: number): number;
5853
disableLog(disable: boolean): void;
5954
disableWarnings(disable: boolean): void;

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"e2e-tests": "grunt && grunt downloadBrowser && karma start test/karma.conf.js"
2626
},
2727
"dependencies": {
28-
"rtcpeerconnection-shim": "^1.2.15",
2928
"sdp": "^2.12.0"
3029
},
3130
"engines": {
@@ -49,7 +48,6 @@
4948
"karma-browserify": "^5.2.0",
5049
"karma-chai": "^0.1.0",
5150
"karma-chrome-launcher": "^2.2.0",
52-
"karma-edge-launcher": "^0.4.1",
5351
"karma-firefox-launcher": "^1.3.0",
5452
"karma-mocha": "^1.3.0",
5553
"karma-mocha-reporter": "^2.2.3",

src/js/adapter_factory.js

-21
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as utils from './utils';
99

1010
// Browser shims.
1111
import * as chromeShim from './chrome/chrome_shim';
12-
import * as edgeShim from './edge/edge_shim';
1312
import * as firefoxShim from './firefox/firefox_shim';
1413
import * as safariShim from './safari/safari_shim';
1514
import * as commonShim from './common_shim';
@@ -18,7 +17,6 @@ import * as commonShim from './common_shim';
1817
export function adapterFactory({window} = {}, options = {
1918
shimChrome: true,
2019
shimFirefox: true,
21-
shimEdge: true,
2220
shimSafari: true,
2321
}) {
2422
// Utils.
@@ -95,25 +93,6 @@ export function adapterFactory({window} = {}, options = {
9593

9694
commonShim.shimRTCIceCandidate(window, browserDetails);
9795
commonShim.shimConnectionState(window, browserDetails);
98-
commonShim.shimMaxMessageSize(window, browserDetails);
99-
commonShim.shimSendThrowTypeError(window, browserDetails);
100-
break;
101-
case 'edge':
102-
if (!edgeShim || !edgeShim.shimPeerConnection || !options.shimEdge) {
103-
logging('MS edge shim is not included in this adapter release.');
104-
return adapter;
105-
}
106-
logging('adapter.js shimming edge.');
107-
// Export to the adapter global object visible in the browser.
108-
adapter.browserShim = edgeShim;
109-
110-
edgeShim.shimGetUserMedia(window, browserDetails);
111-
edgeShim.shimGetDisplayMedia(window, browserDetails);
112-
edgeShim.shimPeerConnection(window, browserDetails);
113-
edgeShim.shimReplaceTrack(window, browserDetails);
114-
115-
// the edge shim implements the full RTCIceCandidate object.
116-
11796
commonShim.shimMaxMessageSize(window, browserDetails);
11897
commonShim.shimSendThrowTypeError(window, browserDetails);
11998
break;

src/js/edge/edge_shim.js

-89
This file was deleted.

src/js/edge/filtericeservers.js

-51
This file was deleted.

src/js/edge/getdisplaymedia.js

-24
This file was deleted.

src/js/edge/getusermedia.js

-31
This file was deleted.

src/js/utils.js

-5
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,6 @@ export function detectBrowser(window) {
174174
result.browser = 'chrome';
175175
result.version = extractVersion(navigator.userAgent,
176176
/Chrom(e|ium)\/(\d+)\./, 2);
177-
} else if (navigator.mediaDevices &&
178-
navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { // Edge.
179-
result.browser = 'edge';
180-
result.version = extractVersion(navigator.userAgent,
181-
/Edge\/(\d+).(\d+)$/, 2);
182177
} else if (window.RTCPeerConnection &&
183178
navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { // Safari.
184179
result.browser = 'safari';

test/e2e/connection.js

-9
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,6 @@ describe('establishes a connection', () => {
212212
});
213213

214214
it('with no explicit end-of-candidates', function(done) {
215-
if (window.adapter.browserDetails.browser === 'edge') {
216-
this.timeout(10000);
217-
}
218215
pc1.oniceconnectionstatechange = function() {
219216
if (pc1.iceConnectionState === 'connected' ||
220217
pc1.iceConnectionState === 'completed') {
@@ -245,12 +242,6 @@ describe('establishes a connection', () => {
245242
});
246243

247244
describe('with datachannel', function() {
248-
beforeEach(function() {
249-
if (window.adapter.browserDetails.browser === 'edge') {
250-
this.skip();
251-
}
252-
});
253-
254245
it('establishes a connection', (done) => {
255246
pc1.oniceconnectionstatechange = function() {
256247
if (pc1.iceConnectionState === 'connected' ||

test/e2e/simulcast.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ describe('simulcast', () => {
1919
});
2020

2121
it('using transceivers APIs', function() {
22-
if (window.adapter.browserDetails.browser === 'edge' ||
23-
window.adapter.browserDetails.browser === 'safari') {
22+
if (window.adapter.browserDetails.browser === 'safari') {
2423
this.skip();
2524
}
2625
const constraints = {video: true};

test/karma.conf.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ const os = require('os');
1212

1313
let browsers;
1414
if (process.env.BROWSER) {
15-
if (process.env.BROWSER === 'MicrosoftEdge') {
16-
browsers = ['Edge'];
17-
} else if (process.env.BROWSER === 'safari') {
15+
if (process.env.BROWSER === 'safari') {
1816
browsers = ['Safari'];
1917
} else if (process.env.BROWSER === 'Electron') {
2018
browsers = ['electron'];
@@ -24,7 +22,7 @@ if (process.env.BROWSER) {
2422
} else if (os.platform() === 'darwin') {
2523
browsers = ['chrome', 'firefox', 'Safari'];
2624
} else if (os.platform() === 'win32') {
27-
browsers = ['chrome', 'firefox', 'Edge'];
25+
browsers = ['chrome', 'firefox'];
2826
} else {
2927
browsers = ['chrome', 'firefox'];
3028
}

test/unit/adapter_factory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('adapter factory', () => {
2727
afterEach(() => {
2828
utils.detectBrowser.restore();
2929
});
30-
['Chrome', 'Firefox', 'Safari', 'Edge'].forEach(browser => {
30+
['Chrome', 'Firefox', 'Safari'].forEach(browser => {
3131
it(browser + ' when disabled', () => {
3232
sinon.stub(utils, 'detectBrowser').returns({
3333
browser: browser.toLowerCase()

0 commit comments

Comments
 (0)