minimal_webkit_testbrowser: Add switch for plugins.
This commit is contained in:
parent
55cf470436
commit
3a95cd470a
@ -25,6 +25,7 @@ import argparse
|
||||
|
||||
from PyQt5.QtCore import QUrl
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
from PyQt5.QtWebKit import QWebSettings
|
||||
from PyQt5.QtWebKitWidgets import QWebView
|
||||
|
||||
|
||||
@ -32,6 +33,8 @@ def parse_args():
|
||||
"""Parse commandline arguments."""
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('url', help='The URL to open')
|
||||
parser.add_argument('--plugins', '-p', help='Enable plugins',
|
||||
default=False, action='store_true')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
@ -43,6 +46,10 @@ if __name__ == '__main__':
|
||||
wv.loadStarted.connect(lambda: print("Loading started"))
|
||||
wv.loadProgress.connect(lambda p: print("Loading progress: {}%".format(p)))
|
||||
wv.loadFinished.connect(lambda: print("Loading finished"))
|
||||
|
||||
if args.plugins:
|
||||
wv.settings().setAttribute(QWebSettings.PluginsEnabled, True)
|
||||
|
||||
wv.load(QUrl.fromUserInput(args.url))
|
||||
wv.show()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user