Comments (14)
Hi @MarByteBeep
I followed your instructions and yes, I'm now seeing the console log messages.
So to clarify for others I replaced the onConsoleMessageAdded function with your code below in
C:\Users****\AppData\Roaming\npm\node_modules\remotedebug-ios-webkit-adapter\out\protocols\ios\ios.js
onConsoleMessageAdded(msg){
let message = msg.params.message;
let type;
let method = "Runtime.consoleAPICalled";
if(message.type === "log") {
switch(message.level) {
case "log": type = "log"; break;
case "info": type = "info"; break;
case "error": type = "error"; break;
default: type = "log";
}
} else {
type = message.type;
}
const consoleMessage = {
source: message.source,
level: type,
text: message.text,
lineNumber: message.line,
timestamp: (new Date).getTime(),
url: message.url,
stackTrace: message.stackTrace ? {
callFrames: message.stackTrace
} : undefined,
args:message.parameters,
networkRequestId: message.networkRequestId,
};
if(type == "error"){
method = "Log.entryAdded";
this._target.fireEventToTools(method, {entry:consoleMessage});
}else
this._target.fireEventToTools(method, consoleMessage);
return Promise.resolve(null);
}
Many thanks
Derek
from remotedebug-ios-webkit-adapter.
@DStillingfleet before closing it, shouldn't this be part of a fix? Now the devs might think that this isn't an issue anymore, while the bug is still present in the codebase.
from remotedebug-ios-webkit-adapter.
@DStillingfleet bug still exists, no console.log() lines show up
from remotedebug-ios-webkit-adapter.
Fix from @anurag-sudo still works and still not included into latest version.
from remotedebug-ios-webkit-adapter.
I am having the same issue when using async await.
from remotedebug-ios-webkit-adapter.
I was able to fix this by making changes in onConsoleMessageAdded
function in file ios.ts
Updated piece of code
let message = msg.params.message;
let type;
let method = "Runtime.consoleAPICalled";
if(message.type === "log") {
switch(message.level) {
case "log": type = "log"; break;
case "info": type = "info"; break;
case "error": type = "error"; break;
default: type = "log";
}
} else {
type = message.type;
}
const consoleMessage = {
source: message.source,
level: type,
text: message.text,
lineNumber: message.line,
timestamp: (new Date).getTime(),
url: message.url,
stackTrace: message.stackTrace ? {
callFrames: message.stackTrace
} : undefined,
args:message.parameters,
networkRequestId: message.networkRequestId,
};
if(type == "error"){
method = "Log.entryAdded";
this._target.fireEventToTools(method, {entry:consoleMessage});
}else
this._target.fireEventToTools(method, consoleMessage);
return Promise.resolve(null);
}
from remotedebug-ios-webkit-adapter.
Console logs still don't show. Looks like the fix didn't help after all. I'm using version 0.4.2
from remotedebug-ios-webkit-adapter.
+1 same issue, only seeing some warnings and not 90% of the console output
from remotedebug-ios-webkit-adapter.
Same problem. I see some warnings, but no console logs.
from remotedebug-ios-webkit-adapter.
@anurag-sudo the changes you propose already seem to be part of
npm\node_modules\remotedebug-ios-webkit-adapter\out\test\protocols\ios\ios.js
Copying that file to
npm\node_modules\remotedebug-ios-webkit-adapter\out\protocols\ios\
didn't make the problem go away for me unfortunately. Is there anything else I need to do in order to let this work?
A workaround would be to replace all console.log
calls to console.error
, as those do seem to be popping up in the console.
from remotedebug-ios-webkit-adapter.
I noticed that the file ios.ts
in test
folder is missing few items that I mentioned above.
-
The
method
name in the currrent scenario isLog.entryAdded
however according to me it should be used forerrors
type only and for the rest type you can use method asRuntime.consoleAPICalled
. -
In the object
consoleMessage
there is a new property addedargs
whose value ismessage.parameters
. -
And finally for logs type
error
objectconsoleMessage
is wrapped in another object, however thats not the case for other log types. By following these steps I was able to arrive at the solution above.
Can you try these steps and lets see if that works ?
from remotedebug-ios-webkit-adapter.
I've reopened the issue so that the developers can see it.
from remotedebug-ios-webkit-adapter.
Related: https://stackoverflow.com/questions/62690137/chrome-devtools-console-hides-all-messages-from-remote-device (not solved as of 2020-12-14)
from remotedebug-ios-webkit-adapter.
This project is now super-seeded by https://inspect.dev/ – a new developer tool for macOS and Windows to inspect and debug your web apps and websites in Safari and WebViews on iOS devices.
RemoteDebug iOS WebKit Adapter is not proactively maintained or extended.
from remotedebug-ios-webkit-adapter.
Related Issues (20)
- Erase device in Android Studio HOT 1
- New automated releases processes in place via Actions HOT 1
- Installation without scoop HOT 1
- Error handling message from target. HOT 1
- Can't add breakpoint in macos? HOT 1
- iOS 13.4.1 + Windows + Listening 9000 = Nothing HOT 3
- "No websocket endpoint found" error HOT 6
- run remotedebug-ios-webkit-adpater get error HOT 1
- Perfermance cannot be opend on Mac with Chrome HOT 1
- Can only inspect pages on Safari not Chrome HOT 2
- Remote debug for iOS devices not working on chrome. HOT 4
- Debug apps that run JavaScriptCore on Mac HOT 2
- support iOS 14 HOT 1
- Not seeing chrome(iPhone 8) anywhere HOT 2
- SSL Cert issue: WebSocket network error: The operation couldn’t be completed. (OSStatus error -9807.) HOT 1
- Unable to find ios_webkit_debug_proxy.exe when not installed with Scoop HOT 1
- Listener not working on iOS 14.4 HOT 3
- Issue with console and can't see the app console.log messages. HOT 1
- fyi complaint to the european unity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remotedebug-ios-webkit-adapter.