Use zero-based index for id

Related issue:
- https://github.com/AdguardTeam/AdguardFilters/issues/75762
This commit is contained in:
Raymond Hill 2021-05-14 10:30:46 -04:00
parent 7574d16509
commit cdf6088dfa
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@
const phs = document.querySelectorAll('.adsbygoogle'); const phs = document.querySelectorAll('.adsbygoogle');
const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;'; const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;';
for ( let i = 0; i < phs.length; i++ ) { for ( let i = 0; i < phs.length; i++ ) {
const id = `aswift_${(i+1)}`; const id = `aswift_${i}`;
if ( document.querySelector(`iframe#${id}`) !== null ) { continue; } if ( document.querySelector(`iframe#${id}`) !== null ) { continue; }
const fr = document.createElement('iframe'); const fr = document.createElement('iframe');
fr.id = id; fr.id = id;