1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Scripts: Use document.createEvent instead of new Event

This commit is contained in:
David Rosca 2015-08-31 19:58:42 +02:00
parent 32a0db31b3
commit 2e6b9b7fce
2 changed files with 8 additions and 7 deletions

View File

@ -58,6 +58,7 @@ SOURCES += \
adblock/adblockdialog.cpp \ adblock/adblockdialog.cpp \
adblock/adblockicon.cpp \ adblock/adblockicon.cpp \
adblock/adblockmanager.cpp \ adblock/adblockmanager.cpp \
adblock/adblockmatcher.cpp \
adblock/adblockrule.cpp \ adblock/adblockrule.cpp \
adblock/adblocksearchtree.cpp \ adblock/adblocksearchtree.cpp \
adblock/adblocksubscription.cpp \ adblock/adblocksubscription.cpp \
@ -222,11 +223,13 @@ SOURCES += \
tools/progressbar.cpp \ tools/progressbar.cpp \
tools/qzregexp.cpp \ tools/qzregexp.cpp \
tools/qztools.cpp \ tools/qztools.cpp \
tools/scripts.cpp \
tools/sqldatabase.cpp \ tools/sqldatabase.cpp \
tools/toolbutton.cpp \ tools/toolbutton.cpp \
tools/treewidget.cpp \ tools/treewidget.cpp \
tools/widget.cpp \ tools/widget.cpp \
webengine/javascript/externaljsobject.cpp \ webengine/javascript/externaljsobject.cpp \
webengine/javascript/autofilljsobject.cpp \
webengine/loadrequest.cpp \ webengine/loadrequest.cpp \
webengine/webinspector.cpp \ webengine/webinspector.cpp \
webengine/webpage.cpp \ webengine/webpage.cpp \
@ -235,9 +238,6 @@ SOURCES += \
webtab/searchtoolbar.cpp \ webtab/searchtoolbar.cpp \
webtab/tabbedwebview.cpp \ webtab/tabbedwebview.cpp \
webtab/webtab.cpp \ webtab/webtab.cpp \
adblock/adblockmatcher.cpp \
tools/scripts.cpp \
webengine/javascript/autofilljsobject.cpp
HEADERS += \ HEADERS += \
3rdparty/ecwin7.h \ 3rdparty/ecwin7.h \
@ -254,6 +254,7 @@ HEADERS += \
adblock/adblockdialog.h \ adblock/adblockdialog.h \
adblock/adblockicon.h \ adblock/adblockicon.h \
adblock/adblockmanager.h \ adblock/adblockmanager.h \
adblock/adblockmatcher.h \
adblock/adblockrule.h \ adblock/adblockrule.h \
adblock/adblocksearchtree.h \ adblock/adblocksearchtree.h \
adblock/adblocksubscription.h \ adblock/adblocksubscription.h \
@ -422,11 +423,13 @@ HEADERS += \
tools/progressbar.h \ tools/progressbar.h \
tools/qzregexp.h \ tools/qzregexp.h \
tools/qztools.h \ tools/qztools.h \
tools/scripts.h \
tools/sqldatabase.h \ tools/sqldatabase.h \
tools/toolbutton.h \ tools/toolbutton.h \
tools/treewidget.h \ tools/treewidget.h \
tools/widget.h \ tools/widget.h \
webengine/javascript/externaljsobject.h \ webengine/javascript/externaljsobject.h \
webengine/javascript/autofilljsobject.h \
webengine/loadrequest.h \ webengine/loadrequest.h \
webengine/webinspector.h \ webengine/webinspector.h \
webengine/webpage.h \ webengine/webpage.h \
@ -435,9 +438,6 @@ HEADERS += \
webtab/searchtoolbar.h \ webtab/searchtoolbar.h \
webtab/tabbedwebview.h \ webtab/tabbedwebview.h \
webtab/webtab.h \ webtab/webtab.h \
adblock/adblockmatcher.h \
tools/scripts.h \
webengine/javascript/autofilljsobject.h
FORMS += \ FORMS += \
adblock/adblockaddsubscriptiondialog.ui \ adblock/adblockaddsubscriptiondialog.ui \

View File

@ -28,7 +28,8 @@ QString Scripts::setupWebChannel()
"function registerExternal(e) {" "function registerExternal(e) {"
" window.external = e;" " window.external = e;"
" if (window.external) {" " if (window.external) {"
" var event = new Event('_qupzilla_external_created');" " var event = document.createEvent('Event');"
" event.initEvent('_qupzilla_external_created', true, true);"
" document.dispatchEvent(event);" " document.dispatchEvent(event);"
" }" " }"
"}" "}"