perf: lazily create the anchor tag used for URL resolving (#18571)
This commit is contained in:
parent
449d2752f2
commit
18acda7888
1 changed files with 2 additions and 1 deletions
|
@ -20,8 +20,9 @@ import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-in
|
||||||
const { defineProperty } = Object
|
const { defineProperty } = Object
|
||||||
|
|
||||||
// Helper function to resolve relative url.
|
// Helper function to resolve relative url.
|
||||||
const a = window.document.createElement('a')
|
let a: HTMLAnchorElement
|
||||||
const resolveURL = function (url: string) {
|
const resolveURL = function (url: string) {
|
||||||
|
a = a || window.document.createElement('a')
|
||||||
a.href = url
|
a.href = url
|
||||||
return a.href
|
return a.href
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue