Instantly share code, notes, and snippets.

Embed
What would you like to do?
from threading import Thread
from time import sleep
import webview
def load_slack():
sleep(1)
# OSX specific
webkit = webview.cocoa.BrowserView.instance.webkit
webkit.setCustomUserAgent_((
'User-Agent: '
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) '
'AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/61.0.3163.100 Safari/537.36'
))
webview.load_url('https://slack.com/signin')
t = Thread(target=load_slack)
t.start()
# This blocks
webview.create_window('SlackLite', 'about:blank')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment