Advertisement
here2share

# js_blur.py

Nov 25th, 2019
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. # js_blur.py
  2.  
  3. import tempfile
  4. import webbrowser
  5. import os
  6.  
  7. js_data = '''<!DOCTYPE html>
  8. <html>
  9. <body>
  10.  
  11. <svg height="140" width="140">
  12.  <defs>
  13.    <filter id="f2" x="0" y="0" width="200%" height="200%">
  14.      <feOffset result="offOut" in="SourceGraphic" dx="20" dy="20" />
  15.      <feGaussianBlur result="blurOut" in="offOut" stdDeviation="10" />
  16.      <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
  17.    </filter>
  18.  </defs>
  19.  <rect width="90" height="90" stroke="green" stroke-width="3"
  20.  fill="yellow" filter="url(#f2)" />
  21. </svg>
  22.  
  23. </body>
  24. </html>'''
  25.  
  26. chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
  27.  
  28. tf = tempfile.mktemp(".html", "JSdemo_")
  29. print tf
  30. with open(tf, 'w') as temp:
  31.     temp.write(js_data)
  32. webbrowser.get(chrome_path).open(tf)
  33. os.remove(tf)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement