You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added those to an extension, then executed this from the background:
apis={};Object.keys(chrome).filter(k=>typeofchrome[k]==="object").forEach(k=>Object.keys(chrome[k]).filter(j=>typeofchrome[k][j]==="function").forEach(j=>{try{// trollolololol, or pass an unlikely number of argumentschrome[k][j](undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined);}catch(err){if(err.message.includes("No matching signature.")&&err.message.includes("function callback")){apis[k]=apis[k]||{};apis[k][j]=`chrome.${k}.${j}`;}}}));console.log(apis);JSON.stringify(apis);
@dlh3 Cheers. That's a really nice way of programmatically finding all the methods with a callback function.
I think there is a route to a programmatically configured API here, but the current list (while not dynamic) is mostly tested and includes some manual removals (such as #26).
I suspect the risk of breaking existing implementation with this change might be higher than the potential benefit of supporting new or missing APIs.
Next steps would be to compare this generated list to the existing one, and test and manually add missing ones.
Happy to help. I agree that a programmatic solution could follow from this, though I believe it would be fairly inefficient. My intent was really to provide a way for generating a list for the purpose of comparing against the currently implemented list.
@KeithHenry I noticed in a comment from last year that you didn't have a way to reliably detect the promiseable functions in the chrome API.
I took a stab at generating something that might help.
I started by collecting all documented permissions:
I added those to an extension, then executed this from the background:
And that yielded this:
Hope this helps!
The text was updated successfully, but these errors were encountered: