def run(self): Instance.record("view", JWebView(self.config)) if self.config['window']["transparent"]: from JAK.Utils import JavaScript JavaScript.css( "body, html {background-color:transparent !important;background-image:none !important;}", "JAK") if self.config['webview']["addCSS"]: from JAK.Utils import JavaScript JavaScript.css(self.config['webview']["addCSS"], "user") print("Custom CSS detected") if self.config['webview']["runJavaScript"]: from JAK.Utils import JavaScript JavaScript.send(self.config['webview']["runJavaScript"]) print("Custom JavaScript detected") win = Instance.auto("win", JWindow(self.config)) if self.config['window']["fullScreen"]: screen = getScreenGeometry() win.resize(screen.width(), screen.height()) else: win.resize(win.default_size("width"), win.default_size("height")) win.setFocusPolicy(Qt.WheelFocus) win.show() win.setFocus() win.window_original_position = win.frameGeometry() result = self.exec_() sys.exit(result)
def run(self): Instance.record("view", JWebView(self.config)) if self.config["add_CSS"]: from JAK.Utils import JavaScript JavaScript.css(self.config["add_CSS"]) print("Custom CSS detected") if self.config["run_JavaScript"]: from JAK.Utils import JavaScript JavaScript.send(self.config["run_JavaScript"]) print("Custom JavaScript detected") win = Instance.auto("win", JWindow(self.config)) win.resize(win.default_size("width"), win.default_size("height")) win.show() win.window_original_position = win.frameGeometry() result = self.exec_() sys.exit(result)
def run(self): if "://" not in self.web_contents: self.web_contents = f"https://{self.web_contents}" Instance.record( "view", JWebView(self.title, self.icon, self.web_contents, self.debug, self.transparent, self.online, self.url_rules, self.cookies_path, self.user_agent, self.custom_css, self.custom_js)) win = Instance.auto( "win", JWindow(self.title, self.icon, self.transparent, self.toolbar)) win.resize(win.default_size("width"), win.default_size("height")) win.show() win.window_original_position = win.frameGeometry() if self.debug: print(Instance.get_instances()) result = self.exec_() sys.exit(result)