add isExternalURL

pull/694/head
yann300 4 years ago
parent a7465b5623
commit e160cdd9a6
  1. 11
      apps/remix-ide/src/app/compiler/compiler-imports.js

@ -14,7 +14,7 @@ const profile = {
name: 'contentImport',
displayName: 'content import',
version: packageJson.version,
methods: ['resolve', 'resolveAndSave']
methods: ['resolve', 'resolveAndSave', 'isExternalUrl']
}
module.exports = class CompilerImports extends Plugin {
@ -105,6 +105,15 @@ module.exports = class CompilerImports extends Plugin {
return /^([^/]+)/.exec(url)
}
isExternalUrl (url) {
for (const handler of this.handlers()) {
if (handler.match.exec(url)) {
return true
}
}
return false
}
/**
* resolve the content of @arg url. This only resolves external URLs.
*

Loading…
Cancel
Save