We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 584cb86 commit b50031aCopy full SHA for b50031a
src/background/main.js
@@ -121,9 +121,21 @@ Main.prototype = {
121
}
122
});
123
124
+ let accessControlAllowOrigin = '';
125
+
126
+ if (details.frameId === 0 && /^https:\/\/[^.]+\.fanbox\.cc/.test(details.initiator)) {
127
+ accessControlAllowOrigin = details.initiator;
128
+ details.responseHeaders.push({
129
+ name: 'Access-Control-Allow-Credentials',
130
+ value: 'true'
131
+ });
132
+ } else {
133
+ accessControlAllowOrigin = '*';
134
+ }
135
136
details.responseHeaders.push({
- name: 'access-control-allow-origin',
- value: '*'
137
+ name: 'Access-Control-Allow-Origin',
138
+ value: accessControlAllowOrigin
139
140
141
return { responseHeaders: details.responseHeaders };
0 commit comments