Skip to content

Commit

Permalink
Add runonclick check for Safari
Browse files Browse the repository at this point in the history
Fixes #839
  • Loading branch information
CompuIves committed Jun 14, 2018
1 parent e97edaf commit 4bbfd98
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/app/src/embed/components/App/index.js
Expand Up @@ -46,6 +46,15 @@ type State = {
highlightedLines: Array<number>,
};

const isSafari = () => {
const ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('safari') !== -1) {
return ua.indexOf('chrome') === -1;
}

return false;
};

export default class App extends React.PureComponent<{}, State> {
constructor() {
super();
Expand Down Expand Up @@ -92,7 +101,8 @@ export default class App extends React.PureComponent<{}, State> {
? false
: runOnClick ||
navigator.appVersion.indexOf('X11') !== -1 ||
navigator.appVersion.indexOf('Linux') !== -1,
navigator.appVersion.indexOf('Linux') !== -1 ||
isSafari(),
verticalMode,
highlightedLines: highlightedLines || [],
};
Expand Down

0 comments on commit 4bbfd98

Please sign in to comment.