Skip to content

Commit 6245fdc

Browse files
committed
fix: refine regex filter and remove unused wait function
1 parent 4acfcab commit 6245fdc

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

public/rules/figma.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"condition": {
28-
"regexFilter": "/webpack-artifacts/assets/(?:figma_app[^.]+|[0-9a-zA-Z-]+)\\.min\\.js(?:\\.br)?$",
28+
"regexFilter": "/webpack-artifacts/assets/figma_app[^.]+\\.min\\.js(?:\\.br)?$",
2929
"resourceTypes": ["script"]
3030
}
3131
}

rewrite/figma.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
import waitFor from 'p-wait-for'
2-
31
import { GROUPS } from './config'
42
import { applyGroups } from './shared'
53

6-
async function waitRuntimeReady() {
7-
const getQueue = () => (window.webpackChunk_figma_web_bundler ||= [])
8-
9-
await waitFor(() => {
10-
const queue = getQueue()
11-
return typeof queue.push === 'function' && queue.push !== Array.prototype.push
12-
})
13-
}
14-
154
async function rewriteScript() {
165
const current = document.currentScript as HTMLScriptElement
176
const src = current?.src
@@ -40,8 +29,6 @@ async function rewriteScript() {
4029

4130
const content = afterRules.replaceAll('delete window.figma', 'window.figma = undefined')
4231

43-
await waitRuntimeReady()
44-
4532
Object.defineProperty(document, 'currentScript', {
4633
configurable: true,
4734
get() {

0 commit comments

Comments
 (0)