Skip to content

Commit

Permalink
Eth-provider injection: Check for document.body presence (svg, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
nand2 committed Dec 27, 2023
1 parent ec6e487 commit 55ca60c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/eth-provider-preload.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
const { ipcRenderer } = require('electron')

window.onload = async function() {
// Only inject eth-provider is there is a document body (e.g. not for SVGs)
if(document.body == null) {
return
}

// Fetch the JS of eth-provider being exposed on window.ethereum
// (Cannot use file reading here)
let webpackedScript = await ipcRenderer.invoke('getEthProviderJs')
Expand Down

0 comments on commit 55ca60c

Please sign in to comment.