I chose FF 45 as it was the oldest version available which supports the code the camera code uses. I was trying to go for the most primitive version of FF as I could.
Herein lies my issue. I am trying to feel my way around using Scratchpad in browser context. I am finding that I cannot directly access JS objects/functions on the camera page, at least not how I have attempted. Here is an example:
In scratchpad within the page context, I can run:
Code: Select all
// Code run in camera webpage context.
// ViewImage is a function within the camera webpage's code.
dump(window.ViewImage + "\n");
However, in Browser context:
Code: Select all
// Code run in browser context:
// Webpage is loaded in gBrowser.browsers[0].
function XXXXRun() {
let initBrowser = gBrowser.browsers[0];
let win = initBrowser.docShell.DOMWindow.window;
dump(win.ViewImage + "\n");
}
XXXXRun();
Code: Select all
// Code run in browser context:
// Webpage is loaded in gBrowser.browsers[0].
function XXXXRun() {
let initBrowser = gBrowser.browsers[0];
let win = initBrowser.docShell.DOMWindow.window;
dump(win.document.getElementById("some_id_unique_to_the_camera_page") + "\n");
}
XXXXRun();
I ultimately intend to modify the browser code rather than running an addon inside of it. I have successfully made modifications to the code already to add features to the camera UI which involve DOM manipulation. Eventually the UI will be radically altered where it will not appear like a browser at all. However I thought this might be the best place to ask my question, for if I am able to understand how this is normally accomplished using an addon, I might be able to figure out how to modify the browser code directly. Or if someone knows how I can access the page's objects using Scratchpad in browser context, that would be better, as I could use the code directly.