Skip to content

Commit 0732ba3

Browse files
authored
Polyfill the window.customElements (#23592) (#23595)
Backport #23592 Close #23590 It seems that some browsers don't support customElements
1 parent 726d6a5 commit 0732ba3

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

package-lock.json

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
1616
"@primer/octicons": "17.10.2",
1717
"@vue/compiler-sfc": "3.2.45",
18+
"@webcomponents/custom-elements": "1.5.1",
1819
"add-asset-webpack-plugin": "2.0.1",
1920
"ansi-to-html": "0.7.2",
2021
"asciinema-player": "3.0.1",

web_src/js/webcomponents/GiteaOriginUrl.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import '@webcomponents/custom-elements'; // automatically adds custom elements for older browsers that don't support it
2+
13
// this is a Gitea's private HTML component, it converts an absolute or relative URL to an absolute URL with the current origin
24
window.customElements.define('gitea-origin-url', class extends HTMLElement {
35
connectedCallback() {

0 commit comments

Comments
 (0)