Below is an example demonstrating how to request XPCOM access from Javascript:
How to create a file using javascript in Mozilla Firefox
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
I am interested in finding a way to enable XPCOM access for my Selenium test scripts, allowing Javascript to directly write raw image data to a file. This poses a follow-up question on how to extract pixel data efficiently:
Firefox, Selenium, toDataURL, Uint8ClampedArray and Python
My objectives are as follows:
Enable XPCOM access for Javascript executed through Selenium
Render images on a Canvas element
Retrieve canvas pixels as raw image data (with a public API available on the canvas itself)
Write raw image data to a file using XPCOM interfaces at a specified location
Please note: Encoding such as PNG is not suitable. The raw data format is preferred for efficiency, as it will be directly used for video encoding purposes.