Android Question Hide element on (specific) html page in web view

plager

Member
Hi folks,
I'd like to kindly ask for help. This stuff really drives me mad. I spent with it two or three afternoons and still can't go any firther. I tried literally everything what I found across the forum and it still won't work :(

There is a modal window on the page:
https://chat.openai.com/chat/
As you can see on the attached screenshot, it is packed within one element with id 'headlessui-dialog-:r0:'.
If I delete it via developer console in the (desktop) browser, it works.
If I write a small extension and inject it into (desktop) browser, it works.
If I put this into address bar in (desktop) browser, it works: 'javascript:document.getElementById('headlessui-dialog-:r0:').remove();'
This modal shows everytime, when I load the page in webview. However, if I use a 'regular' web browser (I use vivaldi), this modal shows up only once. No matter if on mobile phone, or windows desktop.

Now, I am not about to investigate, why it shows up every time in the webview. (but small hint would help, if anyone knows). I want to simply remove that element.
But don't know how.

What I tried:
- run it via javascript in any way I found on the forum
- run it with 'on demand', that means I made a menu in activity and tried to remove it with it, in case it doesn't exist when 'webView1_PageFinished' fires.
- tried to use library WebViewExtras and also WebViewExtras2
- no javascript worked for me except simple alert("Hello world");

I attach screenshot and project. Project is only one file with about 150 lines. In the 'Sub menu_help_Click' and 'Sub webView1_PageFinished' you can see, what I tried. At the top of the code there are some lines with urls leading to this forum - that's what I went through.

So simple question is: how can I remove that element? Maybe I am lame, maybe it cannot be achieved.
Many thanks for your help guys.
 

Attachments

  • openAI_2.JPG
    openAI_2.JPG
    140.2 KB · Views: 59
  • openai.zip
    10.7 KB · Views: 60
Top