Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. @Override
  2. public void onPageFinished(WebView view, String url)
  3. {
  4. webView.loadUrl("javascript:(function() { "
  5. + "var el = document.querySelectorAll('div[data-sigil]');"
  6. + "for(var i=0;i<el.length; i++)"
  7. + "{"
  8. + "var sigil = el[i].dataset.sigil;"
  9. + "if(sigil.indexOf('inlineVideo') > -1){"
  10. + "delete el[i].dataset.sigil;"
  11. + "var jsonData = JSON.parse(el[i].dataset.store);"
  12. + "el[i].setAttribute('onClick', 'FBDownloader.processVideo(\"'+jsonData['src']+'\");');"
  13. + "}" + "}" + "})()");
  14. }
  15.  
  16. @Override
  17. public void onLoadResource(WebView view, String url)
  18. {
  19. webView.loadUrl("javascript:(function prepareVideo() { "
  20. + "var el = document.querySelectorAll('div[data-sigil]');"
  21. + "for(var i=0;i<el.length; i++)"
  22. + "{"
  23. + "var sigil = el[i].dataset.sigil;"
  24. + "if(sigil.indexOf('inlineVideo') > -1){"
  25. + "delete el[i].dataset.sigil;"
  26. + "console.log(i);"
  27. + "var jsonData = JSON.parse(el[i].dataset.store);"
  28. + "el[i].setAttribute('onClick', 'FBDownloader.processVideo(\"'+jsonData['src']+'\",\"'+jsonData['videoID']+'\");');"
  29. + "}" + "}" + "})()");
  30. webView.loadUrl("javascript:( window.onload=prepareVideo;)()");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement