File tree Expand file tree Collapse file tree 5 files changed +13
-3
lines changed
Expand file tree Collapse file tree 5 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 22
33# Changelog
44
5+ ## 0.8.2
6+
7+ - Fixed script replacement after Figma update.
8+
59## 0.8.1
610
711- Fixed script replacement after Figma update.
Original file line number Diff line number Diff line change 1+ import { REWRITE_PATTERN , REWRITE_REPLACER } from '@/shared/rewrite'
2+
13export default defineUnlistedScript ( async ( ) => {
24 const markers = [ 'delete window.figma' , '.createAPI()' ]
35
@@ -19,7 +21,7 @@ export default defineUnlistedScript(async () => {
1921 let content = await ( await fetch ( src ) ) . text ( )
2022
2123 if ( matchFile ( content ) ) {
22- content = content . replace ( / \. u s e r I D ; i f \( [ ^ ) ] * \) { / , '.userId;if(true){}else{' )
24+ content = content . replace ( REWRITE_PATTERN , REWRITE_REPLACER )
2325 }
2426
2527 // document.currentScript will be `null` if we run with `new Function()`
Original file line number Diff line number Diff line change 22 "name" : " tempad-dev" ,
33 "description" : " Inspect panel on Figma, for everyone." ,
44 "private" : true ,
5- "version" : " 0.8.1 " ,
5+ "version" : " 0.8.2 " ,
66 "type" : " module" ,
77 "scripts" : {
88 "dev" : " wxt" ,
Original file line number Diff line number Diff line change 1+ import { REWRITE_PATTERN } from '@/shared/rewrite'
12import { chromium } from 'playwright-chromium'
23
34const ASSETS_PATTERN = / \/ w e b p a c k - a r t i f a c t s \/ a s s e t s \/ \d + - [ 0 - 9 a - f ] + \. m i n \. j s ( \. b r ) ? $ /
4- const REWRITE_PATTERN = / \. u s e r I D ; i f \( [ ^ ) ] * \) { /
55const MARKERS = [ 'delete window.figma' , '.createAPI()' ]
66const MAX_RETRIES = 3
77
Original file line number Diff line number Diff line change 1+ export const REWRITE_PATTERN =
2+ / ( { u s e r I D : ( \w + ) } = ( \w + ) , ( \w + ) = ( \w + ) \| \| ! ! \2& & ( \w + ) ; ) i f \( ! \4\) { ( [ \s \S ] + ?) ; \4& & /
3+
4+ export const REWRITE_REPLACER = '$1if(false){$7;true&&'
You can’t perform that action at this time.
0 commit comments