mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
perf: lazily create the anchor tag used for URL resolving (#18571)
This commit is contained in:
@@ -20,8 +20,9 @@ import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-in
|
||||
const { defineProperty } = Object
|
||||
|
||||
// Helper function to resolve relative url.
|
||||
const a = window.document.createElement('a')
|
||||
let a: HTMLAnchorElement
|
||||
const resolveURL = function (url: string) {
|
||||
a = a || window.document.createElement('a')
|
||||
a.href = url
|
||||
return a.href
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user