Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Paypal post-robot messaging on checkout.js - how to turn off debug mode

I've tried few approaches to disable Paypal post-robot debug messages on my browser's console but none seemed to work.

The reason these messages can be quite annoying is that they make debugging the browser harder because there is plenty of them, hiding some other console warnings.

The console logs are coming from Paypal checkout.js file which is loaded as external resource on our domain.

Only thing I have found about debugging on Paypal developers page is here:

https://developer.paypal.com/docs/classic/express-checkout/in-context/javascript_advanced_settings/?mark=debug

I have tried indeed to invert the condition like document.cookie="PPDEBUG=false". However, I'm still seeing the debug messaging coming through because this should be set on a cookie on the paypal sandbox domain.

Example of the console messages:

> ppxo_current_protocol_https Object {timestamp: 148465111111111,
> windowID: "4250cccccc", pageID: "7bd8cccccc", host:
> "www.project.local", path:
> "/projectlocal/fr/checkout/single"…} checkout.js:4617

> ppxo_setup_production Object {timestamp: 148465111111111, windowID:
> "4250cccccc", pageID: "7bd8cccccc", host: "www.project.local",
> path: "/projectlocal/fr/checkout/single"…}

Here another link related: https://github.com/krakenjs/post-robot

like image 309
Alessandro Incarnati Avatar asked Jan 17 '17 11:01

Alessandro Incarnati


2 Answers

If you're using chrome, you can set up regex filters

^(?!.*?(ppxo|xc_|post-robot))

With Filter

Without Filter

like image 139
wafs Avatar answered Nov 18 '22 02:11

wafs


Loading checkout.js with a log level set to 'error' will prevent the 'debug' and 'info' level messages:

<script src="https://www.paypalobjects.com/api/checkout.js" data-log-level="error"></script>

When looking at the JS code from checkout.js, this seems to be the only option:

logLevel: currentScript.getAttribute("data-log-level"),

like image 1
BjrnSmn Avatar answered Nov 18 '22 02:11

BjrnSmn