codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.03k stars 2.27k forks source link

Enable vimmode for Chromium-based browsers on iPadOS #3699

Closed hastebrot closed 4 years ago

hastebrot commented 4 years ago

🐛 bug report

Description of the problem

It seems that user agent strings for Chromium-based browses on iPadOS always include Safari as substring. I tested this with Chrome, and Edge. I did not find a way to change the user agent or to manually set settings.vimmode to true. This means to option to activate VIM-mode is deactivated.

Screenshot 2020-03-16 at 14 22 50

https://github.com/codesandbox/codesandbox-client/blob/fb6c3818b1072c55c45bfe5188de19d23547fb96/packages/app/src/app/pages/common/Modals/PreferencesModal/EditorPageSettings/EditorSettings/index.tsx#L15-L18

How has this issue affected you? What are you trying to accomplish?

I want to use VIM-mode on my iPad.

Your Environment

Software Name/Version
Сodesandbox codesandbox.io
Browser Chrome, Edge
Operating System iPadOS 13.4
hastebrot commented 4 years ago

My user agent string in Google Chrome on iPadOS is

Mozilla/5.0 (iPad; CPU OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/80.0.3987.95 Mobile/15E148 Safari/604.1

CriOS stands for "Chrome on iOS". I guess we have to change the line that tests for Safari to:

const isSafari: boolean = /^((?!chrome|android|crios).)*safari/i.test( 
  navigato.userAgent 
); 

I've tested this in the browser devtools console.

hastebrot commented 4 years ago

Note that Opera Touch includes OPT/ and Microsoft Edge includes EdgiOS/ instead.

maximilianMairinger commented 4 years ago

All browsers on ios must use apples rendering engine (as declared here at 2.5.6). Thus they cannot be chromium based, even if they are called chrome.

I assume vimmode needs some features from blink (googles rendering engine, used in the chromium project) that browsers based on apples webkit branch do not support (yet).

SaraVieira commented 4 years ago

Hey!

Like @maximilianMairinger said even when using a chromium browser on iOS it's basically still safari so because of an expression in the plug-in that's only supported on chrome we can't enable it

Closing this as we have issues about vim support in Firefox and safari