Last active
July 5, 2022 08:45
-
-
Save Fizzadar/3e44babe768edbc2974fa5a7ba49f90a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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