|
|
@ -1,5 +1,4 @@ |
|
|
|
import * as semver from 'semver' |
|
|
|
import * as semver from 'semver' |
|
|
|
const isElectron = require('is-electron') |
|
|
|
|
|
|
|
/* global Worker */ |
|
|
|
/* global Worker */ |
|
|
|
|
|
|
|
|
|
|
|
export const baseURLBin = 'https://binaries.soliditylang.org/bin' |
|
|
|
export const baseURLBin = 'https://binaries.soliditylang.org/bin' |
|
|
@ -35,7 +34,6 @@ export function urlFromVersion (version) { |
|
|
|
* checks a compiler whitelist, browser support and OS. |
|
|
|
* checks a compiler whitelist, browser support and OS. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export function canUseWorker (selectedVersion) { |
|
|
|
export function canUseWorker (selectedVersion) { |
|
|
|
console.log('canUseWorker', selectedVersion) |
|
|
|
|
|
|
|
if (selectedVersion.startsWith('http')) { |
|
|
|
if (selectedVersion.startsWith('http')) { |
|
|
|
return browserSupportWorker() |
|
|
|
return browserSupportWorker() |
|
|
|
} |
|
|
|
} |
|
|
@ -53,7 +51,6 @@ export function canUseWorker (selectedVersion) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function browserSupportWorker () { |
|
|
|
function browserSupportWorker () { |
|
|
|
if(isElectron()) return true |
|
|
|
|
|
|
|
return document ? document.location.protocol !== 'file:' && Worker !== undefined : false |
|
|
|
return document ? document.location.protocol !== 'file:' && Worker !== undefined : false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|