Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove javascript property from Android webview

Hi I want to remove sticky property from reviewButtonVm.positionStaticStyle class in Android Webview.

Below is the javascript code for this

<button>
 <div ng-class="hashButtonVm.positionStaticStyle" class="sticky">
</button>

I tried below webview code

@Override 
public void onPageFinished(final WebView view, String url) {
    super.onPageFinished(view, url);
    view.loadUrl("javascript:$('.hashButtonVm').removeClass('sticky');");
}

but somehow its not working.

like image 432
Ankuj Rana Avatar asked Dec 03 '25 10:12

Ankuj Rana


1 Answers

Try this in your onPageFinished method

 "$('button .sticky').removeClass('sticky');"

Its working for me.

like image 54
John Avatar answered Dec 05 '25 01:12

John



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!