How can I intercept API calls made by the web application? For example, how can I know the web site uses native file system api and intercept its function when user invokes the above function?
await window.showOpenFilePicker()
How can I intercept API calls made by the web application? For example, how can I know the web site uses native file system api and intercept its function when user invokes the above function?
await window.showOpenFilePicker()
You can use the facade (aka decorator) pattern to do this.
Inject code into the page using TamperMonkey to do this:
;(() => {
const old = window.showOpenFilePicker;
window.showOpenFilePicker = () => {
console.log('showOpenFilePicker called');
return old();
}
})();