From 02868c1033f8848e6f511f90f51c31fc6428dd6a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 9 Jun 2019 15:51:48 -0700 Subject: [PATCH 1/4] Remove support for IE11 Fixes #1889 --- README.md | 8 +------- src/Clipboard.ts | 20 ++++---------------- src/Terminal.ts | 4 ---- src/Types.ts | 1 - src/common/Platform.ts | 1 - 5 files changed, 5 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index aa89c700..bee9cc0d 100644 --- a/README.md +++ b/README.md @@ -85,13 +85,7 @@ The xterm.js team maintains the following addons but they can be built by anyone ## Browser Support -Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Here is a list of the versions we aim to support: - -- Chrome latest -- Edge latest -- Firefox latest -- Safari latest -- IE11 +Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Specifically the latest versions of *Chrome*, *Edge*, *Firefox* and *Safari*. Xterm.js works seamlessly in [Electron](https://electronjs.org/) apps and may even work on earlier versions of the browsers, these are the versions we strive to keep working. diff --git a/src/Clipboard.ts b/src/Clipboard.ts index cbb0935e..b7c708c8 100644 --- a/src/Clipboard.ts +++ b/src/Clipboard.ts @@ -38,12 +38,7 @@ export function bracketTextForPaste(text: string, bracketedPasteMode: boolean): * @param ev The original copy event to be handled */ export function copyHandler(ev: ClipboardEvent, term: ITerminal, selectionManager: ISelectionManager): void { - if (term.browser.isMSIE) { - window.clipboardData.setData('Text', selectionManager.selectionText); - } else { - ev.clipboardData.setData('text/plain', selectionManager.selectionText); - } - + ev.clipboardData.setData('text/plain', selectionManager.selectionText); // Prevent or the original text will be copied. ev.preventDefault(); } @@ -66,16 +61,9 @@ export function pasteHandler(ev: ClipboardEvent, term: ITerminal): void { term.cancel(ev); }; - if (term.browser.isMSIE) { - if (window.clipboardData) { - text = window.clipboardData.getData('Text'); - dispatchPaste(text); - } - } else { - if (ev.clipboardData) { - text = ev.clipboardData.getData('text/plain'); - dispatchPaste(text); - } + if (ev.clipboardData) { + text = ev.clipboardData.getData('text/plain'); + dispatchPaste(text); } } diff --git a/src/Terminal.ts b/src/Terminal.ts index d6093316..ccb41527 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -890,10 +890,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp : ev.which !== null && ev.which !== undefined ? ev.which - 1 : null; - - if (Browser.isMSIE) { - button = button === 1 ? 0 : button === 4 ? 1 : button; - } break; case 'mouseup': button = 3; diff --git a/src/Types.ts b/src/Types.ts index a3435614..721ab063 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -365,7 +365,6 @@ export interface IBrowser { userAgent: string; platform: string; isFirefox: boolean; - isMSIE: boolean; isMac: boolean; isIpad: boolean; isIphone: boolean; diff --git a/src/common/Platform.ts b/src/common/Platform.ts index ee82cff4..87d466c0 100644 --- a/src/common/Platform.ts +++ b/src/common/Platform.ts @@ -19,7 +19,6 @@ const platform = (isNode) ? 'node' : navigator.platform; export const isFirefox = !!~userAgent.indexOf('Firefox'); export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent); -export const isMSIE = !!~userAgent.indexOf('MSIE') || !!~userAgent.indexOf('Trident'); // Find the users platform. We use this to interpret the meta key // and ISO third level shifts. From 1bbb51fc1775e359e65a7649a8dbd7672a50dc8a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 9 Jun 2019 15:57:24 -0700 Subject: [PATCH 2/4] Fix compile --- src/Clipboard.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/Clipboard.ts b/src/Clipboard.ts index b7c708c8..9461afa1 100644 --- a/src/Clipboard.ts +++ b/src/Clipboard.ts @@ -5,15 +5,6 @@ import { ITerminal, ISelectionManager } from './Types'; -interface IWindow extends Window { - clipboardData?: { - getData(format: string): string; - setData(format: string, data: string): void; - }; -} - -declare var window: IWindow; - /** * Prepares text to be pasted into the terminal by normalizing the line endings * @param text The pasted text that needs processing before inserting into the terminal From f9b92f886573347850fa66e8c2c2e338187e4259 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 9 Jun 2019 16:19:03 -0700 Subject: [PATCH 3/4] Add note about partial support for IE11 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bee9cc0d..5b139271 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ The xterm.js team maintains the following addons but they can be built by anyone Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Specifically the latest versions of *Chrome*, *Edge*, *Firefox* and *Safari*. +We also partially support *Intenet Explorer 11*, however we do not do workarounds specifically for it unless it's absolutely necessary. For example, copy and paste may not function correctly since `ClipboardEvent.clipboardData` is not supported. + Xterm.js works seamlessly in [Electron](https://electronjs.org/) apps and may even work on earlier versions of the browsers, these are the versions we strive to keep working. ## API From 044a7e327f14aa5efcd78d18ee4c85a7fed01981 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 9 Jun 2019 19:35:47 -0700 Subject: [PATCH 4/4] Clarify partial support --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b139271..4707f195 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ The xterm.js team maintains the following addons but they can be built by anyone Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Specifically the latest versions of *Chrome*, *Edge*, *Firefox* and *Safari*. -We also partially support *Intenet Explorer 11*, however we do not do workarounds specifically for it unless it's absolutely necessary. For example, copy and paste may not function correctly since `ClipboardEvent.clipboardData` is not supported. +We also partially support *Intenet Explorer 11*, meaning xterm.js should work for the most part, but we reserve the right to not provide workarounds specifically for it unless it's absolutely necessary to get the basic input/output flow working. Xterm.js works seamlessly in [Electron](https://electronjs.org/) apps and may even work on earlier versions of the browsers, these are the versions we strive to keep working.