flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

CSS injection issue

Open kbudulski opened this issue 2 months ago • 1 comments

  • [x] I have read the Getting Started section
  • [x] I have already searched for the same problem

Similar issues: https://github.com/pichillilorenzo/flutter_inappwebview/issues/821, https://github.com/pichillilorenzo/flutter_inappwebview/issues/1388

Environment

Technology Version
Flutter version 3.19.5
Plugin version 6.0.0
Android version 13
iOS version
macOS version
Xcode version
Google Chrome version

Device information: Pixel 5 emulator

Description

Expected behavior: Should correctly inject css that is using pseudo-class :has (but that may not matter) and apply style even though there are modifications from web as well, related to hiding some elements.

Current behavior: Elements referenced in such way are not affected.

Moreover I'm kind of confused but I believe some parts of CSS were cached and in a way I cannot remove them. Used CookieManager/WebStorageManager, IDE invalidation, wiping emulator data.

Steps to reproduce

  1. On website use the script, like: .some-parent:has(.someclassname) { display: none }
  2. In injectCSSCode on app side use reversed one (with !important): .some-parent:has(.someclassname) { display: block !important }
  3. Load page to see effects.

kbudulski avatar May 06 '24 07:05 kbudulski