mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
fix: MediaQueryList addEventListener polyfill
This commit is contained in:
21
src/utils/polyfill.ts
Normal file
21
src/utils/polyfill.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// matchMedia polyfill for macOS 10.15
|
||||
if (
|
||||
window.MediaQueryList &&
|
||||
!window.MediaQueryList.prototype.addEventListener
|
||||
) {
|
||||
window.MediaQueryList.prototype.addEventListener = function (
|
||||
name: string,
|
||||
callback: any
|
||||
) {
|
||||
this.addListener(callback);
|
||||
};
|
||||
|
||||
window.MediaQueryList.prototype.removeEventListener = function (
|
||||
name: string,
|
||||
callback: any
|
||||
) {
|
||||
this.removeListener(callback);
|
||||
};
|
||||
}
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user