Code Monkey home page Code Monkey logo

Comments (14)

DStillingfleet avatar DStillingfleet commented on June 11, 2024 8

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.

MarByteBeep avatar MarByteBeep commented on June 11, 2024 4

@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.

FirefighterBlu3 avatar FirefighterBlu3 commented on June 11, 2024 4

@DStillingfleet bug still exists, no console.log() lines show up

from remotedebug-ios-webkit-adapter.

thekip avatar thekip commented on June 11, 2024 2

Fix from @anurag-sudo still works and still not included into latest version.

from remotedebug-ios-webkit-adapter.

dariosalvi78 avatar dariosalvi78 commented on June 11, 2024 1

I am having the same issue when using async await.

from remotedebug-ios-webkit-adapter.

anurag-sudo avatar anurag-sudo commented on June 11, 2024 1

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.

hurrii avatar hurrii commented on June 11, 2024 1

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.

florton avatar florton commented on June 11, 2024

+1 same issue, only seeing some warnings and not 90% of the console output

from remotedebug-ios-webkit-adapter.

MarByteBeep avatar MarByteBeep commented on June 11, 2024

Same problem. I see some warnings, but no console logs.

from remotedebug-ios-webkit-adapter.

MarByteBeep avatar MarByteBeep commented on June 11, 2024

@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.

anurag-sudo avatar anurag-sudo commented on June 11, 2024

@MarByteBeep

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 is Log.entryAdded however according to me it should be used for errors type only and for the rest type you can use method as Runtime.consoleAPICalled.

  • In the object consoleMessage there is a new property added args whose value is message.parameters.

  • And finally for logs type error object consoleMessage 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.

DStillingfleet avatar DStillingfleet commented on June 11, 2024

I've reopened the issue so that the developers can see it.

from remotedebug-ios-webkit-adapter.

chanibal avatar chanibal commented on June 11, 2024

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.

auchenberg avatar auchenberg commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.