-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The example module injection works, but the example patch doesn't work. Here is what I did to make it work:
- Twitter changed their domain so
matchSites: ["twitter.com"]becomesmatchSites: ["x.com"] - Twitter breaks with
patchAll: trueso I changed it topatchAll: false - The module with the string
"(window.__INITIAL_STATE__"is successfully found, but then the string replacement fails because/(const|var) .{1,3}=.\..\(window\.__INITIAL_STATE__/is no longer present in the code. I changed it to{ match: /;var .{1,20}\..\(window\.__INITIAL_STATE__/, replacement: (orig) => `;console.log('Patches work!!!')${orig}` }and that worked. - I had to add unsafe-eval under script-src in the content-security-policy header.
adryd325
Metadata
Metadata
Assignees
Labels
No labels