FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mist/customProtocols.js at develop · hacktar/mist · GitHub
hacktar
/
mist
Public
forked from
ethereum/mist
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
mist
/
customProtocols.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (26 loc) · 1.18 KB
Breadcrumbs
mist
/
customProtocols.js
Copy path
File metadata and controls
37 lines (26 loc) · 1.18 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const
{
protocol
}
=
require
(
'electron'
)
;
protocol
.
registerHttpProtocol
(
'mist'
,
(
request
,
callback
)
=>
{
// callback({mimeType: 'text/html', data: new Buffer('<h5>Response</h5>')});
console
.
log
(
(
request
.
url
.
indexOf
(
'mist://interface'
)
!==
-
1
)
?
global
.
interfaceAppUrl
+
request
.
url
.
replace
(
'mist://interface'
,
''
)
:
''
)
;
const
call
=
{
url
:
(
request
.
url
.
indexOf
(
'mist://interface'
)
!==
-
1
)
?
global
.
interfaceAppUrl
+
request
.
url
.
replace
(
'mist://interface'
,
''
)
:
''
,
// 'http://localhost:3050/' + request.url.replace('mist://',''),
method
:
request
.
method
,
referrer
:
request
.
referrer
,
}
;
console
.
log
(
call
)
;
// console.log(call);
callback
(
call
)
;
}
,
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
'Failed to register protocol'
)
;
}
}
)
;
// protocol.registerProtocol('eth', function(request) {
// var url = request.url.substr(7)
// return new protocol.RequestStringJob({data: 'Hello'});
// });
// protocol.registerProtocol('bzz', function(request) {
// var url = request.url.substr(7)
// return new protocol.RequestStringJob({data: 'Hello'});
// });
// protocol.registerStandardSchemes(['mist','eth', 'bzz']); //'eth', 'bzz'
Back
|
FazBrowse Home
|
New Git URL