diff --git a/js/src/api/api.js b/js/src/api/api.js
index dc8cd9da7..ba3c35cd5 100644
--- a/js/src/api/api.js
+++ b/js/src/api/api.js
@@ -30,11 +30,7 @@ export default class Api extends EventEmitter {
constructor (provider, allowSubscriptions = true) {
super();
- if (!provider || (!isFunction(provider.send) && !isFunction(provider.execute))) {
- throw new Error('Api needs provider with send() function');
- }
-
- if (!isFunction(provider.send)) {
+ if (!provider || !isFunction(provider.send)) {
console.warn(new Error('deprecated: Api needs provider with send() function, old-style Transport found instead'));
}
diff --git a/js/src/api/api.spec.js b/js/src/api/api.spec.js
index 7dd4981d7..e014587ab 100644
--- a/js/src/api/api.spec.js
+++ b/js/src/api/api.spec.js
@@ -22,18 +22,6 @@ import util from './util';
import Api from './api';
describe('api/Api', () => {
- describe('constructor', () => {
- it('requires defined/non-null provider object', () => {
- expect(() => new Api()).to.throw(/Api needs provider/);
- expect(() => new Api(null)).to.throw(/Api needs provider/);
- });
-
- it('requires an send function on the transport object', () => {
- expect(() => new Api({})).to.throw(/Api needs provider/);
- expect(() => new Api({ send: true })).to.throw(/Api needs provider/);
- });
- });
-
describe('interface', () => {
const api = new Api(new Api.Provider.Http(TEST_HTTP_URL, -1));
diff --git a/js/src/api/provider/postMessage.js b/js/src/api/provider/postMessage.js
index b96d730b9..3d7eec1ea 100644
--- a/js/src/api/provider/postMessage.js
+++ b/js/src/api/provider/postMessage.js
@@ -46,7 +46,11 @@ export default class PostMessage {
return;
}
- this._callbacks[id](error, result);
+ if (error) {
+ console.error(from, error);
+ }
+
+ this._callbacks[id](error && new Error(error), result);
this._callbacks[id] = null;
}
}
diff --git a/js/src/dapps/chaindeploy/parity.js b/js/src/dapps/chaindeploy/parity.js
index 1dea0d696..db7446fb9 100644
--- a/js/src/dapps/chaindeploy/parity.js
+++ b/js/src/dapps/chaindeploy/parity.js
@@ -14,7 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
-const api = window.parity.api;
+import Api from '@parity/api';
+
+const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
+const api = new Api(web3Provider);
export {
api
diff --git a/js/src/dapps/console/parity.js b/js/src/dapps/console/parity.js
index d05cc2350..4c730e907 100644
--- a/js/src/dapps/console/parity.js
+++ b/js/src/dapps/console/parity.js
@@ -15,8 +15,11 @@
// along with Parity. If not, see .
import Web3 from 'web3';
+import Api from '@parity/api';
+
+const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
+const api = new Api(web3Provider);
-const api = window.parent.secureApi;
let web3;
api.parity.dappsUrl().then(url => {
diff --git a/js/src/dapps/dappreg/parity.js b/js/src/dapps/dappreg/parity.js
index a17966bd1..a87645712 100644
--- a/js/src/dapps/dappreg/parity.js
+++ b/js/src/dapps/dappreg/parity.js
@@ -14,7 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
-const api = window.parent.secureApi;
+import Api from '@parity/api';
+
+const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
+const api = new Api(web3Provider);
function trackRequest (signerRequestId, statusCallback) {
return api.pollMethod('parity_checkRequest', signerRequestId)
diff --git a/js/src/dapps/githubhint/Application/application.css b/js/src/dapps/githubhint/Application/application.css
index 509b3fd20..7efe34da3 100644
--- a/js/src/dapps/githubhint/Application/application.css
+++ b/js/src/dapps/githubhint/Application/application.css
@@ -22,7 +22,6 @@
}
.container {
- font-family: 'Roboto';
vertical-align: middle;
padding: 4em 0;
margin: 0 0 2em 0;
diff --git a/js/src/dapps/githubhint/parity.js b/js/src/dapps/githubhint/parity.js
index 7118ce087..db7446fb9 100644
--- a/js/src/dapps/githubhint/parity.js
+++ b/js/src/dapps/githubhint/parity.js
@@ -14,7 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
-const api = window.parent.secureApi;
+import Api from '@parity/api';
+
+const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
+const api = new Api(web3Provider);
export {
api
diff --git a/js/src/dapps/index.ejs b/js/src/dapps/index.ejs
index aab652fa6..f2645e4ba 100644
--- a/js/src/dapps/index.ejs
+++ b/js/src/dapps/index.ejs
@@ -12,7 +12,7 @@
margin: 0;
padding: 0;
background: white;
- font-family: 'Roboto', sans-serif;
+ font-family: 'Roboto', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva, Arial, sans-serif;
font-size: 16px;
font-weight: 300;
}
@@ -30,8 +30,5 @@
Loading
- <% if (!htmlWebpackPlugin.options.secure) { %>
-
- <% } %>