mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-06 19:02:30 +01:00
more code review re. #3140
This commit is contained in:
parent
7e21eec7ce
commit
143e9c7414
@ -435,17 +435,14 @@ var onBeforeMaybeSpuriousCSPReport = function(details) {
|
|||||||
if ( data instanceof Object ) {
|
if ( data instanceof Object ) {
|
||||||
var report = data['csp-report'];
|
var report = data['csp-report'];
|
||||||
if ( report instanceof Object ) {
|
if ( report instanceof Object ) {
|
||||||
var blockedURI = report['blocked-uri'] ||
|
var blocked = report['blocked-uri'] || report['blockedURI'],
|
||||||
report['blockedURI'],
|
validBlocked = typeof blocked === 'string',
|
||||||
sourceFile = report['source-file'] ||
|
source = report['source-file'] || report['sourceFile'],
|
||||||
report['sourceFile'];
|
validSource = typeof source === 'string';
|
||||||
if (
|
if (
|
||||||
(typeof blockedURI === 'string' ||
|
(validBlocked || validSource) &&
|
||||||
typeof sourceFile === 'string') &&
|
(!validBlocked || !blocked.startsWith('data')) &&
|
||||||
(typeof blockedURI !== 'string' ||
|
(!validSource || !source.startsWith('data'))
|
||||||
blockedURI.startsWith('data') === false) &&
|
|
||||||
(typeof sourceFile !== 'string' ||
|
|
||||||
sourceFile.startsWith('data') === false)
|
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user