Skip to content

Commit

Permalink
fix: Video plackback does not work at Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Dec 21, 2024
1 parent ee34be1 commit e21ff98
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@list-kr/chzzk-anti-grid",
"version": "1.0.2",
"version": "2.0.0",
"description": "",
"type": "module",
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions sources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
// @downloadURL https://cdn.jsdelivr.net/npm/@list-kr/chzzk-anti-grid@latest/dist/chzzk-anti-grid.user.js
// @license MIT
//
// @version 1.0.2
// @version 2.0.0
// @author PiQuark6046 and contributors
//
// @match https://chzzk.naver.com/*
// @match https://*.chzzk.naver.com/*
//
// @description
// @description:ko
// @description 치지직 웹 사이트에 있는 그리드 컴퓨팅 프로그램 설치 강제에 대해 우회하는 유저스크립트입니다
//
// @grant unsafeWindow
// @run-at document-start
Expand Down
21 changes: 5 additions & 16 deletions sources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,11 @@ declare const unsafeWindow: unsafeWindow

const Win = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window

Win.String.prototype.toLowerCase = new Proxy(Win.String.prototype.toLowerCase, {
apply(Target: typeof String.prototype.toLowerCase, ThisArg: string, Args) {
const Result = Reflect.apply(Target, ThisArg, Args)
if (Result === 'windows') {
return ''
Win.Object.defineProperty = new Proxy(Win.Object.defineProperty, {
apply(Target: typeof Win.Object.defineProperty, ThisArg: null, Args: [unknown, string | symbol, PropertyDescriptor]) {
if (typeof Args[1] === 'string' && Args[1] === 'isSupportedPlatform') {
return Reflect.apply(Target, ThisArg, [Args[0], Args[1], { value: () => false, writable: false, enumerable: true, configurable: true }])
}
return Result
}
})

Win.WebGLRenderingContext.prototype.getParameter = new Proxy(Win.WebGLRenderingContext.prototype.getParameter, {
apply(Target: typeof WebGLRenderingContext.prototype.getParameter, ThisArg: unknown, Args: unknown[]) {
const Result = Reflect.apply(Target, ThisArg, Args)
if (new Error().stack.includes('main.')) {
return ''
}
return Result
return Reflect.apply(Target, ThisArg, Args)
}
})

0 comments on commit e21ff98

Please sign in to comment.