Simplify platform handling

This commit is contained in:
Florian Bruhin 2018-01-20 16:43:39 +01:00 committed by GitHub
parent 1e3f11ca13
commit 182bf1d688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -781,12 +781,6 @@ window._qutebrowser.caret = (function() {
*/
CaretBrowsing.blinkFlag = true;
/**
* The os that user is using.
* @type {boolean}
*/
CaretBrowsing.platform = null;
/**
* Check if a node is a control that normally allows the user to interact
* with it using arrow keys. We won't override the arrow keys when such a
@ -879,9 +873,6 @@ window._qutebrowser.caret = (function() {
* first text character in the document.
*/
CaretBrowsing.setInitialCursor = function() {
if (CaretBrowsing.platform) {
CaretBrowsing.isWindows = CaretBrowsing.platform.startsWith("win");
}
const selectionRange = window.getSelection().toString().length;
if (selectionRange === 0) {
positionCaret();
@ -1289,7 +1280,7 @@ window._qutebrowser.caret = (function() {
};
funcs.setPlatform = (platform) => {
CaretBrowsing.platform = platform;
CaretBrowsing.isWindows = platform.startsWith("win");
};
funcs.disableCaret = () => {