Skip to content
Snippets Groups Projects
Unverified Commit 4046f143 authored by MoeShin's avatar MoeShin Committed by GitHub
Browse files

fix: matchMedia().addEventListener #258 (#296)

parent e4e16999
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,27 @@
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Clash Verge</title>
<script>
(function () {
var _matchMedia = window.matchMedia;
window.matchMedia = function () {
var v = _matchMedia.apply(null, arguments);
if (!v.addEventListener) {
v.addEventListener = function () {
if (arguments.length < 2 || arguments[0] !== "change") {
console.error("Cannot proxy addEventListener:", arguments);
return;
}
if (arguments.length > 2) {
console.warn("Proxy addEventListener:", arguments);
}
v.addListener(arguments[1]);
};
}
return v;
};
})();
</script>
</head>
<body>
<div id="root"></div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment