goto: consent banner text stays in the HTML after autoconsent and becomes the page description
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js
Hướng nghiên cứu
Start by tracing goto's consent resolution and collectPopupSelectors, which the issue says already supplies selectors to waitForPopupHidden. Compare that flow with the proposal to remove matched containers and handle pages where no tool is detected; the issue also calls out fetch mode as a separate path. Done means consent text no longer becomes the extracted description, with behavior controlled by an option as proposed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
After goto, the consent banner's text is still in the DOM, even when the banner is no longer visible. Microlink reads page.content() and, for pages with no meta description, takes the description from the page text (metascraper-readability and metascraper-defuddle, parsed in happy-dom with no CSS). Those parsers only see an inline style="display:none" or the hidden attribute, not a banner that a stylesheet class or autoconsent hid. So the banner text becomes the page's description:
We use cookies to optimise site functionality and give you the best possible experience. See our cookie policy.
In 5 of the 8 pages below, the banner was already hidden in the browser when the HTML was captured. In the other 2 it was visible, because neither autoconsent nor dismiss closed it.
URLs
All 8 come from real production requests in the last 7 days. Each one reproduces with the steps below.
| URL | Consent tool | Banner container | Visible after goto |
autoconsent:close |
|---|---|---|---|---|
| https://www.prestontravelcentre.co.uk/special-offers | CookieYes | div.cky-preference-content-wrapper |
no | 166ms |
| https://pathways.kaplaninternational.com/login/index.php | custom | div#cookie-banner |
no | 252ms |
| https://thermalpark.sk/ | CookieYes / Cookie Law Info | div#cookie-law-info-bar |
no | 1ms |
| https://docs.cloud.google.com/docs/security/compliance/fedramp-dod-compliance-scope | Google glue | span#glue-cookie-notification-bar-1-label |
no | 1ms |
| https://www.platformagency.be/ | custom | div#aa-cookiebar-msg |
no | 251ms |
| https://www.presentmodelmanagement.com/ | custom (Next.js) | div#__next > p |
yes | 251ms |
| https://www.libmanuels.fr/reader/9782210115491/2/116 | custom | div.cookie-modal__content |
yes | 252ms |
| https://www.stormtype.com/families/hercules | unknown | not located (the text is split across nodes) | ? | 1ms |
The description each one returns:
- prestontravelcentre: "We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below."
- kaplaninternational: "We use cookies to optimise site functionality and give you the best possible experience. See our cookie policy."
- presentmodelmanagement: "This site uses cookies to provide web functionality and performance measurement. Got it"
- libmanuels: "LibManuels utilise des cookies techniques. Ils sont nécessaires pour une expérience optimale et sont exemptés de consentement."
- stormtype: "Cookies help us deliver our services. By using our services, you agree to our use of cookies.Got it"
- thermalpark: "Webová stránka thermalpark.sk spoločnosti THERMALPARK DS, a.s používa cookies aby pre vás zabezpečil ten najlepší zážitok…"
- docs.cloud.google.com: "docs.cloud.google.com uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic. Learn more"
- platformagency: "Met cookies werkt deze website vlot en kunnen we u inhoud op maat tonen. Als u verder surft of op "Ja, ik accepteer cookies" klikt…"
None of the 8 has a meta description or og:description, which is why the text fallback runs at all. stormtype has one, but it is empty (<meta content="" name="description">).
autoconsent:close taking about 250ms is POPUP_DETECTION_GRACE_MS running out, so autoconsent matched no consent tool on 5 of the pages. That includes prestontravelcentre and thermalpark, which use CookieYes, and the compact rules do have CookieYes selectors (.cky-consent-container). Note that on prestontravelcentre the text comes from CookieYes's preference center (cky-preference-content-wrapper), not its banner.
How common
8 of 4,836 production pages (0.17%) that returned a 200 in a sample of 5,315 domains (one URL per domain, 7 days of api:meta:info fields logs), all in prerender mode.
Reproduce
const createBrowser = require('browserless')
const browser = createBrowser()
const ctx = await browser.createContext()
const html = await ctx.html('https://pathways.kaplaninternational.com/login/index.php')
// html still contains <div id="cookie-banner">…We use cookies to optimise…</div>,
// while getComputedStyle on it in the page reports it is not rendered.
Visibility was checked in the page after goto with el.getClientRects().length > 0, computed display, visibility and opacity. DEBUG=browserless:goto gives the autoconsent durations.
Versions: browserless 14.7.3, @browserless/goto 14.7.3. Run from a residential IP in Spain. Production runs in DigitalOcean nyc3, and many consent tools only show to EU visitors, so the set of pages showing a banner from production can differ.
Proposal
Once consent is resolved in goto, remove the consent containers from the DOM instead of only waiting for them to hide:
- When autoconsent matched a consent tool, remove the elements its
detectPopupselectors match.collectPopupSelectorsalready collects them forwaitForPopupHidden. - When it matched nothing (5 of 8 here), autoconsent's selectors can't help. Options: a generic pass that removes elements whose
idorclassmatchescookie|consent|gdpr|cky|cookiebarand that are either not rendered orposition: fixed|sticky, or adding the missing tools to autoconsent upstream. The generic pass covers custom banners (kaplan, platformagency, libmanuels, presentmodelmanagement) that no rule list will.
Putting this behind an option keeps the default the same for screenshots.
Fetch-mode requests (no browser) carry the same banner HTML and are not covered by this. That needs the same removal applied to the HTML in html-get or metascraper.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- JavaScript
- Star
- 1.8k
- Fork
- 90
- Merge trung bình
- 5 giờ 42 phút
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microlinkhq/browserless
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
microlinkhq/browserless#1022 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cursor emulation supportĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
microlinkhq/browserless#284 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[screenshot] mobile overlayĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
microlinkhq/browserless#59 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[screenshot] add url on top barĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microlinkhq/browserless#58 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Enable data saverĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
microlinkhq/browserless#25 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microlinkhq/browserless
Issue tương tự
-
security-advisory
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MinBZK/regelrecht#2173 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Claude Code: replace stub has no cut cue, a 6128 B Bash output reads as the one line `END6000`Đang mởbug repro-ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
mksglu/context-mode#1454 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
microlinkhq/metascraper#905 ·
Maintainer thường phản hồi trong vòng 1 ngày