Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # js_blur.py
- import tempfile
- import webbrowser
- import os
- js_data = '''<!DOCTYPE html>
- <html>
- <body>
- <svg height="140" width="140">
- <defs>
- <filter id="f2" x="0" y="0" width="200%" height="200%">
- <feOffset result="offOut" in="SourceGraphic" dx="20" dy="20" />
- <feGaussianBlur result="blurOut" in="offOut" stdDeviation="10" />
- <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
- </filter>
- </defs>
- <rect width="90" height="90" stroke="green" stroke-width="3"
- fill="yellow" filter="url(#f2)" />
- </svg>
- </body>
- </html>'''
- chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
- tf = tempfile.mktemp(".html", "JSdemo_")
- print tf
- with open(tf, 'w') as temp:
- temp.write(js_data)
- webbrowser.get(chrome_path).open(tf)
- os.remove(tf)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement