Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

www.bing.com #170168

Closed
adguard-bot opened this issue Jan 8, 2024 · 4 comments
Closed

www.bing.com #170168

adguard-bot opened this issue Jan 8, 2024 · 4 comments

Comments

@adguard-bot
Copy link

Issue URL (Annoyance)

https://www.bing.com/search?toWww=1&redig=2AEC5FFEFBBB43D5A3EBCFE3AA269B2A&q=Bing+AI&showconv=1

Comment

<cib-message
  type="text"
  source="bot"
  mode="conversation"
  muid-consent=""
  serp-slot="none"
  product="bing"
  density="normal"
  table-version="1"
  katex-scroll=""
  output-background=""
  disable-citation-fix=""
  chat-type="consumer"
  chat-state="muid-user-consent-not-given"
>
  <slot name="playground-inner" slot="playground-inner"></slot>
  <slot name="playground-outer" slot="playground-outer"></slot>
</cib-message>;

Username: @rakleed

[NSFW] Screenshots

Screenshot 1

Screenshot 1

System configuration

Information Value
AdGuard product: AdGuard for Mac v2.13.0.1558 release
Browser: Chrome
Stealth mode options: Strip URLs from tracking parameters,
Hide your search queries,
Hide your Referrer from third-parties,
Hide your User-Agent,
Remove X-Client-Data header from HTTP requests,
Protect against DPI,
Disable cache for third-party requests,
Block trackers
DNS filtering: server: https://dns.cloudflare.com/dns-query
Filters: Ad Blocking:
AdGuard Base

Privacy:
AdGuard Tracking Protection,
AdGuard URL Tracking

Social Widgets:
AdGuard Social Media

Annoyances:
AdGuard Cookie Notices,
AdGuard Popups,
AdGuard Mobile App Banners,
AdGuard Other Annoyances,
AdGuard Widgets

Language-specific:
AdGuard Russian
Userscripts: IMDb Tomatoes (url: https://github.com/chocolateboy/userscripts/raw/master/src/imdb-tomatoes.user.js)
Nova YouTube (url: https://update.greasyfork.org/scripts/433360/Nova%20YouTube.user.js)
AdGuard Extra (url: https://userscripts.adtidy.org/release/adguard-extra/1.0/adguard-extra.user.js)
@jellizaveta
Copy link
Contributor

@AdamWr Could you please check?

@jellizaveta jellizaveta added the A: Waiting for data Waiting for more information from the user label Jan 10, 2024
@AdamWr
Copy link
Member

AdamWr commented Jan 10, 2024

To reproduce it's necessary to use copilot.
If I'm not wrong, it's basing on some cookies, but it's rather "random" value, so if I'm not mistaken, set-cookie in this case will not works.
Another problem is that this button is in the shadow root, so trusted-click-element also doesn't work in this case.
We could add a JavaScript rule to click it automatically, something like:

bing.com#%#(()=>{if(!location.pathname.includes("/search"))return;const t={attributes:!0,childList:!0,subtree:!0},e=(t,e)=>{for(const n of t){const t=n.target.querySelector(".privacy-statement + .get-started-btn-wrapper > button.inline-explicit");t&&(t.click(),e.disconnect())}},n={apply:(n,o,c)=>{const r=Reflect.apply(n,o,c);if(o&&o.matches("cib-muid-consent")){new MutationObserver(e).observe(r,t)}return r}};window.Element.prototype.attachShadow=new Proxy(window.Element.prototype.attachShadow,n)})();
Code:
(() => {
  if (!location.pathname.includes('/search')) {
    return;
  }
  const config = {
    attributes: true,
    childList: true,
    subtree: true
  };
  const callback = (mutationList, observer) => {
    for (const mutation of mutationList) {
      const button = mutation.target.querySelector('.privacy-statement + .get-started-btn-wrapper > button.inline-explicit');
      if (button) {
        // debugger;
        button.click();
        observer.disconnect();
      }
    }
  };
  const wrapper = (target, thisArg, args) => {
    const shadowEl = Reflect.apply(target, thisArg, args);
    // Start observing the target node for configured mutations
    // only if target element is cib-muid-consent
    if (thisArg && thisArg.matches('cib-muid-consent')) {
      const observer = new MutationObserver(callback);
      observer.observe(shadowEl, config);
    }
    return shadowEl;
  };
  const handler = {
    apply: wrapper
  };
  window.Element.prototype.attachShadow = new Proxy(window.Element.prototype.attachShadow, handler);
})();

but I'm not sure if it should be added.

@Alex-302 should we fix it?

@Alex-302
Copy link
Member

@AdamWr Why not?)

@AdamWr
Copy link
Member

AdamWr commented Jan 10, 2024

Okay, I will test this rule a bit more and add it tomorrow, if I do not notice any breakage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants