Skip to content

Content script is not injected if there is a tag (with embed attribute) before doctype declaration #1825

Description

@AdamWr

Steps to reproduce:

  1. Add these rules:
example.org##body
||example.org^$replace=/<!doctype html>/<tag embed="PHNjcmlwdCBzcmM9Imh0dHBzOi8vZXhhbXBsZS5vcmcvIiBhc3luYz0iYXN5bmMiPjwvc2NyaXB0Pg=="><\/tag><!doctype html>/
  1. Go to - https://example.org/

Website should be blank, but script is not injected, so element hiding rules do not work.

Screenshot with $replace rule enabled

image

Screenshot with $replace rule disabled

image


Real case is here - AdguardTeam/AdguardFilters#165930
It has been fixed by $replace rule, so to reproduce please add this rule:

@@||transfermarkt.com.tr^$replace=/<tm-consent[\s\S]*?<\/tm-consent>(<!DOCTYPE html>)/\$1/,document

to user rules.

AdGuard for Windows 7.15.0 nightly 28 (4460) (CL 1.13.79, DL 2.4.0 )

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions