How to use the is-ipfs.url function in is-ipfs

To help you get started, we’ve selected a few is-ipfs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ipfs-shipyard / ipfs-companion / add-on / src / lib / dnslink.js View on Github external
canLookupURL (requestUrl) {
      // skip URLs that could produce infinite recursion or weird loops
      const state = getState()
      return state.dnslinkPolicy &&
        requestUrl.startsWith('http') &&
        !IsIpfs.url(requestUrl) &&
        !requestUrl.startsWith(state.apiURLString) &&
        !requestUrl.startsWith(state.gwURLString)
    },
github fbaiodias / ipfs-chrome-station / chrome / app / background / interceptor.js View on Github external
function interceptor (details) {
  var parsedUrl = url.parse(details.url)
  if (isIPFSUrl(details.url) && parsedUrl.host.indexOf(settings.host) === -1) {
    const node = `${settings.host}:${settings.port}`

    parsedUrl.protocol = 'http:'
    parsedUrl.host = node
    parsedUrl.hostname = node
    const localUrl = url.format(parsedUrl)
    console.log('redirected', details.url, 'to', node)
    return { redirectUrl: localUrl }
  }
}
github ipfs-shipyard / ipfs-companion / add-on / src / lib / ipfs-path.js View on Github external
isIpfsPageActionsContext (url) {
      return Boolean(url && !url.startsWith(getState().apiURLString) && (
        IsIpfs.url(url) ||
        IsIpfs.subdomain(url) ||
        dnslinkResolver.cachedDnslink(new URL(url).hostname)
      ))
    },
github fbaiodias / ipfs-chrome-station / app / popup / js / screens / menu.js View on Github external
chrome.tabs.query({ currentWindow: true, active: true }, (tabs) => {
      if (!isIPFSUrl(tabs[0].url)) {
        return
      }

      const pageUrl = tabs[0].url

      const { hash } = parseUrl(pageUrl)

      this.setState({
        isIpfsPage: true,
        pageUrl,
        pageHash: hash
      })

      chrome.runtime.sendMessage({ method: 'pin.list' }, (response) => {
        const err = response[0]
        const res = response[1]

is-ipfs

A set of utilities to help identify IPFS resources on the web

Apache-2.0 OR MIT
Latest version published 3 months ago

Package Health Score

81 / 100
Full package analysis