Accesing lockscreen DOM on Firefox OS

Hello,

I was working on an add-on to hide the details of the lockscreen notifications so I was playing a bit from the webide console.

The problem is that I wasn’t able to get the DOM elements I want to play with.

document.querySelectorAll("#notifications-lockscreen-container > .detail");

Returns empty, what am I doing wrong? Is this supposed not to work from webide console?

Cheers.

PS: I ended using css to hide some elements for now.

1 Like

Not really helpful to you - but could you share a link to your code please - I’m learning FxOS addons currently :stuck_out_tongue:

You might want to try posting on stackoverflow, they seem to get some activity in the firefox-os tag - http://stackoverflow.com/questions/tagged/firefox-os

I’ll tty this later, when I’ll have my flame, but judging from lockscreen’s css code your selector should probably be:

#notifications-lockscreen-container .notification > div.detail

OK, so the problem is that the lockscreen is inside an iframe, that’s why it was impossible to access to the DOM element.

The way to get it:

document.querySelector("#systemapp").contentDocument.querySelectorAll("#notifications-lockscreen-container .detail");

This is the add-on code, but at this moment just using css to hide the elements.

1 Like