[#4320] Do not inject jQuery in DApps browser

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Julien Eluard 2018-05-22 14:28:31 +02:00 committed by Pedro Pombeiro
parent e3b283056c
commit 09c11e9061
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
4 changed files with 1 additions and 18 deletions

File diff suppressed because one or more lines are too long

View File

@ -335,12 +335,6 @@
(fn [{:keys [unviewed-messages]}] (fn [{:keys [unviewed-messages]}]
(count unviewed-messages))) (count unviewed-messages)))
(reg-sub
:web-view-extra-js
:<- [:get-current-chat]
(fn [current-chat]
(:web-view-extra-js current-chat)))
(reg-sub (reg-sub
:get-photo-path :get-photo-path
:<- [:get-contacts] :<- [:get-contacts]

View File

@ -78,7 +78,6 @@
{:keys [address]} [:get-current-account] {:keys [address]} [:get-current-account]
{:keys [dapp? contact url browser-id] :as browser} [:get-current-browser] {:keys [dapp? contact url browser-id] :as browser} [:get-current-browser]
{:keys [can-go-back? can-go-forward? error?]} [:get :browser/options] {:keys [can-go-back? can-go-forward? error?]} [:get :browser/options]
extra-js [:web-view-extra-js]
rpc-url [:get :rpc-url] rpc-url [:get :rpc-url]
network-id [:get-network-id]] network-id [:get-network-id]]
[react/keyboard-avoiding-view styles/browser [react/keyboard-avoiding-view styles/browser
@ -106,13 +105,12 @@
:on-load #(re-frame/dispatch [:update-browser-options {:error? false}]) :on-load #(re-frame/dispatch [:update-browser-options {:error? false}])
:on-error #(re-frame/dispatch [:update-browser-options {:error? true}]) :on-error #(re-frame/dispatch [:update-browser-options {:error? true}])
:injected-on-start-loading-java-script (str js-res/web3 :injected-on-start-loading-java-script (str js-res/web3
js-res/jquery
(get-inject-js url) (get-inject-js url)
(js-res/web3-init (js-res/web3-init
rpc-url rpc-url
(ethereum/normalized-address address) (ethereum/normalized-address address)
(str network-id))) (str network-id)))
:injected-java-script (str js-res/webview-js extra-js)}] :injected-java-script js-res/webview-js}]
[react/view styles/background [react/view styles/background
[react/text (i18n/label :t/enter-dapp-url)]]) [react/text (i18n/label :t/enter-dapp-url)]])
[react/view styles/toolbar [react/view styles/toolbar

View File

@ -29,10 +29,6 @@
(slurp "resources/js/i18n.js"))) (slurp "resources/js/i18n.js")))
(def webview-js (slurp "resources/js/webview.js")) (def webview-js (slurp "resources/js/webview.js"))
(def jquery (str
" if (typeof jQuery2 == 'undefined') {"
(slurp "resources/js/vendors/jquery-3.1.1.min.js")
"}"))
(def web3 (str "; if (typeof Web3 == 'undefined') {" (def web3 (str "; if (typeof Web3 == 'undefined') {"
(slurp "node_modules/web3/dist/web3.min.js") (slurp "node_modules/web3/dist/web3.min.js")
"}")) "}"))