Merge webview.js into provider.js
Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
This commit is contained in:
parent
98229c46cf
commit
84e50ffe4e
|
@ -7,6 +7,18 @@
|
||||||
ReactNativeWebView.postMessage(JSON.stringify(data));
|
ReactNativeWebView.postMessage(JSON.stringify(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var history = window.history;
|
||||||
|
var pushState = history.pushState;
|
||||||
|
history.pushState = function(state) {
|
||||||
|
setTimeout(function () {
|
||||||
|
bridgeSend({
|
||||||
|
type: 'history-state-changed',
|
||||||
|
navState: { url: location.href, title: document.title }
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
return pushState.apply(history, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
function sendAPIrequest(permission, params) {
|
function sendAPIrequest(permission, params) {
|
||||||
var messageId = callbackId++;
|
var messageId = callbackId++;
|
||||||
var params = params || {};
|
var params = params || {};
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
(function () {
|
|
||||||
var history = window.history;
|
|
||||||
var pushState = history.pushState;
|
|
||||||
history.pushState = function(state) {
|
|
||||||
setTimeout(function () {
|
|
||||||
bridgeSend({
|
|
||||||
type: 'history-state-changed',
|
|
||||||
navState: { url: location.href, title: document.title }
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
return pushState.apply(history, arguments);
|
|
||||||
};
|
|
||||||
})();
|
|
|
@ -136,8 +136,7 @@
|
||||||
:on-message #(re-frame/dispatch [:browser/bridge-message-received (.. ^js % -nativeEvent -data)])
|
:on-message #(re-frame/dispatch [:browser/bridge-message-received (.. ^js % -nativeEvent -data)])
|
||||||
:on-load #(re-frame/dispatch [:browser/loading-started])
|
:on-load #(re-frame/dispatch [:browser/loading-started])
|
||||||
:on-error #(re-frame/dispatch [:browser/error-occured])
|
:on-error #(re-frame/dispatch [:browser/error-occured])
|
||||||
:injected-java-script-before-content-loaded (js-res/ethereum-provider (str network-id))
|
:injected-java-script-before-content-loaded (js-res/ethereum-provider (str network-id))}])]
|
||||||
:injected-java-script js-res/webview-js}])]
|
|
||||||
[navigation url-original can-go-back? can-go-forward? dapps-account]
|
[navigation url-original can-go-back? can-go-forward? dapps-account]
|
||||||
[permissions.views/permissions-panel [(:dapp? browser) (:dapp browser) dapps-account] show-permission]
|
[permissions.views/permissions-panel [(:dapp? browser) (:dapp browser) dapps-account] show-permission]
|
||||||
(when show-tooltip
|
(when show-tooltip
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
(ns status-im.utils.js-resources
|
(ns status-im.utils.js-resources
|
||||||
(:require-macros [status-im.utils.slurp :refer [slurp]]))
|
(:require-macros [status-im.utils.slurp :refer [slurp]]))
|
||||||
|
|
||||||
(def webview-js (slurp "resources/js/webview.js"))
|
|
||||||
(def provider-file (slurp "resources/js/provider.js"))
|
(def provider-file (slurp "resources/js/provider.js"))
|
||||||
(defn ethereum-provider [network-id]
|
(defn ethereum-provider [network-id]
|
||||||
(str "window.statusAppNetworkId = \"" network-id "\";"
|
(str "window.statusAppNetworkId = \"" network-id "\";"
|
||||||
|
|
Loading…
Reference in New Issue