inject global environment

This commit is contained in:
王劲鹏 2020-01-18 11:46:07 +08:00 committed by osborn
parent 1a6b730146
commit 2a16350c2b
3 changed files with 25 additions and 0 deletions

View File

@ -3752,6 +3752,14 @@ let global$2 = new Function('return this')();
global$2.doric = doric; global$2.doric = doric;
global$2.context = jsObtainContext(contextId); global$2.context = jsObtainContext(contextId);
global$2.Entry = jsObtainEntry(contextId); global$2.Entry = jsObtainEntry(contextId);
global$2.Environment = {
'platform': 'debugger',
'platformVersion': '1.0',
'appName': '',
'appVersion': '',
'screenWidth': 0,
'screenHeight': 0
};
// dev kit client // dev kit client
const devClient = new WebSocketClient('ws://localhost:7777'); const devClient = new WebSocketClient('ws://localhost:7777');
devClient.on('open', function open() { devClient.on('open', function open() {

View File

@ -25,6 +25,15 @@ global.doric = doric
global.context = doric.jsObtainContext(contextId) global.context = doric.jsObtainContext(contextId)
global.Entry = doric.jsObtainEntry(contextId) global.Entry = doric.jsObtainEntry(contextId)
global.Environment = {
'platform': 'debugger',
'platformVersion': '1.0',
'appName': '',
'appVersion': '',
'screenWidth': 0,
'screenHeight': 0
}
// dev kit client // dev kit client
const devClient = new WebSocketClient('ws://localhost:7777') const devClient = new WebSocketClient('ws://localhost:7777')
devClient.on('open', function open() { devClient.on('open', function open() {

View File

@ -24,6 +24,14 @@ let global = new Function('return this')();
global.doric = doric; global.doric = doric;
global.context = doric.jsObtainContext(contextId); global.context = doric.jsObtainContext(contextId);
global.Entry = doric.jsObtainEntry(contextId); global.Entry = doric.jsObtainEntry(contextId);
global.Environment = {
'platform': 'debugger',
'platformVersion': '1.0',
'appName': '',
'appVersion': '',
'screenWidth': 0,
'screenHeight': 0
};
// dev kit client // dev kit client
const devClient = new WebSocketClient('ws://localhost:7777'); const devClient = new WebSocketClient('ws://localhost:7777');
devClient.on('open', function open() { devClient.on('open', function open() {