You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
event.source.postMessage({action: 'initError',error: 'Default export not found'},event.origin);
53
55
initError=true;
54
56
return;
55
57
}
56
-
constdefaultVar=defaultMatch[1];
58
+
57
59
// TO EXTENSION REVIEWERS (mostly Mozilla):
58
60
// This script is part of Twitter's security challenge, before mindlessly rejecting extension actually review what code does please! It's in sandbox for a reason.
59
61
// It only ever executes code from trusted Twitter domain, abs.twimg.com (specifically their script that generates security headers)
60
62
// It's impossible to have it contained in extension itself, since it's generated dynamically
61
63
// you can see where script is loaded in scripts/twchallenge.js
62
64
// it also can't use any extension APIs, since it's contained in object url iframe
63
-
constpatchedChallengeData=challengeData.replace(
64
-
`default:()=>${defaultVar}`,
65
-
`default:(window._CHALLENGE=()=>${defaultVar})`
66
-
);
65
+
letpatchedChallengeData;
66
+
if(assignMatch){
67
+
patchedChallengeData=challengeData.replace(
68
+
assignMatch[0],
69
+
`${assignMatch[1]}window.__CHALLENGE_FN__=()=>`
70
+
);
71
+
}else{
72
+
constdefaultVar=propMatch[1];
73
+
patchedChallengeData=challengeData.replace(
74
+
`default:()=>${defaultVar}`,
75
+
`default:(window._CHALLENGE=()=>${defaultVar})`
76
+
);
77
+
}
67
78
eval(patchedChallengeData);
68
79
69
80
// 1) Collect all module factories that have already been pushed
0 commit comments