For the complete documentation index, see llms.txt. This page is also available as Markdown.

Extending Charles with your own Javascript

You can add your own JS to execute within an active tab and also pass values back to bubble. Please have a look at this tutorial: https://share.descript.com/view/NARVH1XDUbL

Code snippet

//send message to parent window
var msg = {
    "requestType":"customFunction"
}
window.parent.postMessage(JSON.stringify(msg), "*");


//listening for messages from the parent window
window.addEventListener('message', function (event) {
    // create object from event.data
    eventdata = JSON.parse(event.data);
    if (eventdata.returnType == "h1") {
        console.log('Received h1: ', eventdata.value);
    }
}, false);

Last updated