Skip to content

Commit 4bbfd98

Browse files
committed
Add runonclick check for Safari
Fixes codesandbox#839
1 parent e97edaf commit 4bbfd98

File tree

1 file changed

+11
-1
lines changed
  • packages/app/src/embed/components/App

1 file changed

+11
-1
lines changed

packages/app/src/embed/components/App/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ type State = {
4646
highlightedLines: Array<number>,
4747
};
4848

49+
const isSafari = () => {
50+
const ua = navigator.userAgent.toLowerCase();
51+
if (ua.indexOf('safari') !== -1) {
52+
return ua.indexOf('chrome') === -1;
53+
}
54+
55+
return false;
56+
};
57+
4958
export default class App extends React.PureComponent<{}, State> {
5059
constructor() {
5160
super();
@@ -92,7 +101,8 @@ export default class App extends React.PureComponent<{}, State> {
92101
? false
93102
: runOnClick ||
94103
navigator.appVersion.indexOf('X11') !== -1 ||
95-
navigator.appVersion.indexOf('Linux') !== -1,
104+
navigator.appVersion.indexOf('Linux') !== -1 ||
105+
isSafari(),
96106
verticalMode,
97107
highlightedLines: highlightedLines || [],
98108
};

0 commit comments

Comments
 (0)