]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Drop support for Internet Explorer
authorPierre Ossman <ossman@cendio.se>
Thu, 15 Oct 2020 14:48:08 +0000 (16:48 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 15 Oct 2020 16:53:51 +0000 (18:53 +0200)
.github/workflows/test.yml
README.md
core/input/keyboard.js
core/input/util.js
core/util/browser.js
tests/test.gesturehandler.js
tests/test.helper.js
tests/test.keyboard.js
tests/test.localization.js
tests/test.rfb.js
tests/test.webutil.js

index 5b03504f3426a9c8bede2e637be65c77b3041c3d..a0bcb36b5111f1a92675a96f605f2fd0ca6a8816 100644 (file)
@@ -17,8 +17,6 @@ jobs:
             browser: Safari
           - os: windows-latest
             browser: EdgeHeadless
-          - os: windows-latest
-            browser: IE
       fail-fast: false
     runs-on: ${{ matrix.os }}
     steps:
index b5b84c3c81c66e0ffe9d6872013ea3d268ae3e77..9e8810ef8e23f7c9ce04c05598e7d53e16cdba71 100644 (file)
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@ noVNC uses many modern web technologies so a formal requirement list is
 not available. However these are the minimum versions we are currently
 aware of:
 
-* Chrome 49, Firefox 44, Safari 11, Opera 36, IE 11, Edge 12
+* Chrome 49, Firefox 44, Safari 11, Opera 36, Edge 12
 
 
 ### Server Requirements
index 3ffa6e7ab7c172bafd1f33e7ddcb960f49d55513..bef9081b018449411ff1375fa8ceef98b5c9316a 100644 (file)
@@ -170,9 +170,9 @@ export default class Keyboard {
 
         // If this is a legacy browser then we'll need to wait for
         // a keypress event as well
-        // (IE and Edge has a broken KeyboardEvent.key, so we can't
+        // (Edge has a broken KeyboardEvent.key, so we can't
         // just check for the presence of that field)
-        if (!keysym && (!e.key || browser.isIE() || browser.isEdge())) {
+        if (!keysym && (!e.key || browser.isEdge())) {
             this._pendingKey = code;
             // However we might not get a keypress event if the key
             // is non-printable, which needs some special fallback
index 1b98040be237cdb01a99a4de343253cb950ee179..90fe4293c7082a0d178e4a9895308377ceed0c86 100644 (file)
@@ -110,15 +110,15 @@ export function getKey(evt) {
             return 'Delete';
         }
 
-        // IE and Edge need special handling, but for everyone else we
+        // Edge need special handling, but for everyone else we
         // can trust the value provided
-        if (!browser.isIE() && !browser.isEdge()) {
+        if (!browser.isEdge()) {
             return evt.key;
         }
 
-        // IE and Edge have broken handling of AltGraph so we can only
-        // trust them for non-printable characters (and unfortunately
-        // they also specify 'Unidentified' for some problem keys)
+        // Edge has broken handling of AltGraph so we can only
+        // trust it for non-printable characters (and unfortunately
+        // is also specifies 'Unidentified' for some problem keys)
         if ((evt.key.length !== 1) && (evt.key !== 'Unidentified')) {
             return evt.key;
         }
index 1554801422999b3dcbb2ec43914c034fa343be94..d157b53cba0008c38104456017e2833f64db4954 100644 (file)
@@ -106,10 +106,6 @@ export function isSafari() {
                          navigator.userAgent.indexOf('Chrome') === -1);
 }
 
-export function isIE() {
-    return navigator && !!(/trident/i).exec(navigator.userAgent);
-}
-
 export function isEdge() {
     return navigator && !!(/edge/i).exec(navigator.userAgent);
 }
index ba2f7991ad630c4100dbfa594f36ad6605f0d665..73356be368b217d9d4a23ffe3a4b272bfba20cca 100644 (file)
@@ -3,7 +3,6 @@ const expect = chai.expect;
 import EventTargetMixin from '../core/util/eventtarget.js';
 
 import GestureHandler from '../core/input/gesturehandler.js';
-import * as browser from '../core/util/browser.js';
 
 class DummyTarget extends EventTargetMixin {
 }
@@ -23,12 +22,6 @@ describe('Gesture handler', function () {
     });
 
     beforeEach(function () {
-        // Touch events and gestures are not supported on IE
-        if (browser.isIE()) {
-            this.skip();
-            return;
-        }
-
         target = new DummyTarget();
         gestures = sinon.spy();
         target.addEventListener('gesturestart', gestures);
index b1f438ee50f1866ac7a7295a96f99ca89427cc5f..035b72db273df935a12a7a38b39d6f74911a7a61 100644 (file)
@@ -70,11 +70,6 @@ describe('Helpers', function () {
                 // environments, so we need to redefine it whilst running these
                 // tests.
                 origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
-                if (origNavigator === undefined) {
-                    // Object.getOwnPropertyDescriptor() doesn't work
-                    // properly in any version of IE
-                    this.skip();
-                }
 
                 Object.defineProperty(window, "navigator", {value: {}});
                 if (window.navigator.platform !== undefined) {
@@ -102,7 +97,7 @@ describe('Helpers', function () {
 
     describe('getKey', function () {
         it('should prefer key', function () {
-            if (browser.isIE() || browser.isEdge()) this.skip();
+            if (browser.isEdge()) this.skip();
             expect(KeyboardUtil.getKey({key: 'a', charCode: 'Š'.charCodeAt(), keyCode: 0x42, which: 0x43})).to.be.equal('a');
         });
         it('should map legacy values', function () {
@@ -131,18 +126,13 @@ describe('Helpers', function () {
             expect(KeyboardUtil.getKey({keycode: 0x42})).to.be.equal('Unidentified');
         });
 
-        describe('Broken key AltGraph on IE/Edge', function () {
+        describe('Broken key AltGraph on Edge', function () {
             let origNavigator;
             beforeEach(function () {
                 // window.navigator is a protected read-only property in many
                 // environments, so we need to redefine it whilst running these
                 // tests.
                 origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
-                if (origNavigator === undefined) {
-                    // Object.getOwnPropertyDescriptor() doesn't work
-                    // properly in any version of IE
-                    this.skip();
-                }
 
                 Object.defineProperty(window, "navigator", {value: {}});
                 if (window.navigator.platform !== undefined) {
@@ -157,27 +147,14 @@ describe('Helpers', function () {
                 }
             });
 
-            it('should ignore printable character key on IE', function () {
-                window.navigator.userAgent = "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko";
-                expect(KeyboardUtil.getKey({key: 'a'})).to.be.equal('Unidentified');
-            });
             it('should ignore printable character key on Edge', function () {
                 window.navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393";
                 expect(KeyboardUtil.getKey({key: 'a'})).to.be.equal('Unidentified');
             });
-            it('should allow non-printable character key on IE', function () {
-                window.navigator.userAgent = "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko";
-                expect(KeyboardUtil.getKey({key: 'Shift'})).to.be.equal('Shift');
-            });
             it('should allow non-printable character key on Edge', function () {
                 window.navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393";
                 expect(KeyboardUtil.getKey({key: 'Shift'})).to.be.equal('Shift');
             });
-            it('should allow printable character key with charCode on IE', function () {
-                window.navigator.userAgent = "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko";
-                expect(KeyboardUtil.getKey({key: 'a', charCode: 0x61})).to.be.equal('a');
-                expect(KeyboardUtil.getKey({key: 'Unidentified', charCode: 0x61})).to.be.equal('a');
-            });
             it('should allow printable character key with charCode on Edge', function () {
                 window.navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393";
                 expect(KeyboardUtil.getKey({key: 'a', charCode: 0x61})).to.be.equal('a');
@@ -236,7 +213,7 @@ describe('Helpers', function () {
 
         describe('Numpad', function () {
             it('should handle Numpad numbers', function () {
-                if (browser.isIE() || browser.isEdge()) this.skip();
+                if (browser.isEdge()) this.skip();
                 expect(KeyboardUtil.getKeysym({code: 'Digit5', key: '5', location: 0})).to.be.equal(0x0035);
                 expect(KeyboardUtil.getKeysym({code: 'Numpad5', key: '5', location: 3})).to.be.equal(0xFFB5);
             });
@@ -247,7 +224,7 @@ describe('Helpers', function () {
                 expect(KeyboardUtil.getKeysym({code: 'NumpadDecimal', key: 'Delete', location: 3})).to.be.equal(0xFF9F);
             });
             it('should handle Numpad Decimal key', function () {
-                if (browser.isIE() || browser.isEdge()) this.skip();
+                if (browser.isEdge()) this.skip();
                 expect(KeyboardUtil.getKeysym({code: 'NumpadDecimal', key: '.', location: 3})).to.be.equal(0xFFAE);
                 expect(KeyboardUtil.getKeysym({code: 'NumpadDecimal', key: ',', location: 3})).to.be.equal(0xFFAC);
             });
index 3571d39ce0e646068b6d0f1ffd6332b9230c3c2e..591aa19535e3d3db93b85961412231c7834225b3 100644 (file)
@@ -20,7 +20,7 @@ describe('Key Event Handling', function () {
 
     describe('Decode Keyboard Events', function () {
         it('should decode keydown events', function (done) {
-            if (browser.isIE() || browser.isEdge()) this.skip();
+            if (browser.isEdge()) this.skip();
             const kbd = new Keyboard(document);
             kbd.onkeyevent = (keysym, code, down) => {
                 expect(keysym).to.be.equal(0x61);
@@ -31,7 +31,7 @@ describe('Key Event Handling', function () {
             kbd._handleKeyDown(keyevent('keydown', {code: 'KeyA', key: 'a'}));
         });
         it('should decode keyup events', function (done) {
-            if (browser.isIE() || browser.isEdge()) this.skip();
+            if (browser.isEdge()) this.skip();
             let calls = 0;
             const kbd = new Keyboard(document);
             kbd.onkeyevent = (keysym, code, down) => {
@@ -126,7 +126,7 @@ describe('Key Event Handling', function () {
 
         describe('suppress the right events at the right time', function () {
             beforeEach(function () {
-                if (browser.isIE() || browser.isEdge()) this.skip();
+                if (browser.isEdge()) this.skip();
             });
             it('should suppress anything with a valid key', function () {
                 const kbd = new Keyboard(document, {});
@@ -156,7 +156,7 @@ describe('Key Event Handling', function () {
 
     describe('Fake keyup', function () {
         it('should fake keyup events for virtual keyboards', function (done) {
-            if (browser.isIE() || browser.isEdge()) this.skip();
+            if (browser.isEdge()) this.skip();
             let count = 0;
             const kbd = new Keyboard(document);
             kbd.onkeyevent = (keysym, code, down) => {
@@ -179,7 +179,7 @@ describe('Key Event Handling', function () {
 
     describe('Track Key State', function () {
         beforeEach(function () {
-            if (browser.isIE() || browser.isEdge()) this.skip();
+            if (browser.isEdge()) this.skip();
         });
         it('should send release using the same keysym as the press', function (done) {
             const kbd = new Keyboard(document);
@@ -256,11 +256,6 @@ describe('Key Event Handling', function () {
             // environments, so we need to redefine it whilst running these
             // tests.
             origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
-            if (origNavigator === undefined) {
-                // Object.getOwnPropertyDescriptor() doesn't work
-                // properly in any version of IE
-                this.skip();
-            }
 
             Object.defineProperty(window, "navigator", {value: {}});
             if (window.navigator.platform !== undefined) {
@@ -323,11 +318,6 @@ describe('Key Event Handling', function () {
             // environments, so we need to redefine it whilst running these
             // tests.
             origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
-            if (origNavigator === undefined) {
-                // Object.getOwnPropertyDescriptor() doesn't work
-                // properly in any version of IE
-                this.skip();
-            }
 
             Object.defineProperty(window, "navigator", {value: {}});
             if (window.navigator.platform !== undefined) {
@@ -399,11 +389,6 @@ describe('Key Event Handling', function () {
             // environments, so we need to redefine it whilst running these
             // tests.
             origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
-            if (origNavigator === undefined) {
-                // Object.getOwnPropertyDescriptor() doesn't work
-                // properly in any version of IE
-                this.skip();
-            }
 
             Object.defineProperty(window, "navigator", {value: {}});
             if (window.navigator.platform !== undefined) {
@@ -549,11 +534,6 @@ describe('Key Event Handling', function () {
             // environments, so we need to redefine it whilst running these
             // tests.
             origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
-            if (origNavigator === undefined) {
-                // Object.getOwnPropertyDescriptor() doesn't work
-                // properly in any version of IE
-                this.skip();
-            }
 
             Object.defineProperty(window, "navigator", {value: {}});
             if (window.navigator.platform !== undefined) {
index 301ab79f4b71c7beaf26c2fcfa51c66f0be817cb..311353a1e7d18fe4e64ddcb402c09a410d27cdf0 100644 (file)
@@ -11,11 +11,6 @@ describe('Localization', function () {
             // environments, so we need to redefine it whilst running these
             // tests.
             origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
-            if (origNavigator === undefined) {
-                // Object.getOwnPropertyDescriptor() doesn't work
-                // properly in any version of IE
-                this.skip();
-            }
 
             Object.defineProperty(window, "navigator", {value: {}});
             if (window.navigator.languages !== undefined) {
index da3cc9f646bfb5d10b2e90d637d2d72bc1d1240a..0ac6622020cc340d99eaa5c625a0936211990bec 100644 (file)
@@ -8,26 +8,9 @@ import { encodings } from '../core/encodings.js';
 import { toUnsigned32bit } from '../core/util/int.js';
 import { encodeUTF8 } from '../core/util/strings.js';
 import KeyTable from '../core/input/keysym.js';
-import * as browser  from '../core/util/browser.js';
 
 import FakeWebSocket from './fake.websocket.js';
 
-/* UIEvent constructor polyfill for IE */
-(() => {
-    if (typeof window.UIEvent === "function") return;
-
-    function UIEvent( event, params ) {
-        params = params || { bubbles: false, cancelable: false, view: window, detail: undefined };
-        const evt = document.createEvent( 'UIEvent' );
-        evt.initUIEvent( event, params.bubbles, params.cancelable, params.view, params.detail );
-        return evt;
-    }
-
-    UIEvent.prototype = window.UIEvent.prototype;
-
-    window.UIEvent = UIEvent;
-})();
-
 function push8(arr, num) {
     "use strict";
     arr.push(num & 0xFF);
@@ -2938,14 +2921,6 @@ describe('Remote Frame Buffer Protocol Client', function () {
         });
 
         describe('Gesture event handlers', function () {
-            beforeEach(function () {
-                // Touch events and gestures are not supported on IE
-                if (browser.isIE()) {
-                    this.skip();
-                    return;
-                }
-            });
-
             function gestureStart(gestureType, x, y,
                                   magnitudeX = 0, magnitudeY = 0) {
                 let pos = elementToClient(x, y);
index 2a166ee05f84f168862d930cc543be4f5bf0b6a0..82a9cc6d7d72fe03217c13dade01c37a942d443b 100644 (file)
@@ -22,11 +22,6 @@ describe('WebUtil', function () {
             let origLocalStorage;
             beforeEach(function () {
                 origLocalStorage = Object.getOwnPropertyDescriptor(window, "localStorage");
-                if (origLocalStorage === undefined) {
-                    // Object.getOwnPropertyDescriptor() doesn't work
-                    // properly in any version of IE
-                    this.skip();
-                }
 
                 Object.defineProperty(window, "localStorage", {value: {}});
                 if (window.localStorage.setItem !== undefined) {