Skip to content

Commit

Permalink
Polyfill the window.customElements (#23592) (#23595)
Browse files Browse the repository at this point in the history
Backport #23592

Close #23590

It seems that some browsers don't support customElements
  • Loading branch information
wxiaoguang authored Mar 20, 2023
1 parent 726d6a5 commit 0732ba3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@primer/octicons": "17.10.2",
"@vue/compiler-sfc": "3.2.45",
"@webcomponents/custom-elements": "1.5.1",
"add-asset-webpack-plugin": "2.0.1",
"ansi-to-html": "0.7.2",
"asciinema-player": "3.0.1",
Expand Down
2 changes: 2 additions & 0 deletions web_src/js/webcomponents/GiteaOriginUrl.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@webcomponents/custom-elements'; // automatically adds custom elements for older browsers that don't support it

// this is a Gitea's private HTML component, it converts an absolute or relative URL to an absolute URL with the current origin
window.customElements.define('gitea-origin-url', class extends HTMLElement {
connectedCallback() {
Expand Down

0 comments on commit 0732ba3

Please sign in to comment.