<div dir="ltr"><div>Hi Felipe,</div><div><br></div><div>thank you for working on this, generally this seems like great progress to me.</div><div><br></div><div>I have one slight concern: if I understand correctly, we are aiming to remove the ability for chrome-privileged JS to inject frame/content scripts on the fly, right? I'm currently working on a Shield study which uses a privileged frame script to extract information from the content process it would otherwise not have access to. I have seen other Shield studies use frame scripts as well.</div><div><br></div><div>Am I right in assuming that future studies would need to land IPDL boilerplate in m-c to achieve something like this?</div><div><br></div><div>Thank you!</div><div><br></div><div>Johann<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 8, 2018 at 9:42 PM Felipe G <<a href="mailto:felipc@gmail.com">felipc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello firefox-dev!<br><br>If you’ve ever written code inside of a frame script, and communicated with it over a message manager, you’re going to want to pay close attention, because the world is about to change.<br><br>Over the past couple of months we’ve been splitting most of the code from frame scripts into .jsms to load them on demand. We’ve been doing this to improve content process memory consumption as part of the Fission effort, and have been doing this mostly in an ad-hoc way. Bug 1472491 [1] is creating a general structure to solve this class of problem, and moving most of the frame scripts code to this new structure.<br><br>In short, the messages/listeners/observers will be listed in a declarative way, specifying which module should be loaded and instantiated to respond to these messages.<br>These modules are classes exported from these .jsms, extending an ActorChild class, which has access to the document, the docshell and the message manager. Now you should access them through the class instead of the globals in the frame script. A good example: [2]<br><br>In order to spread knowledge about this change, we’ll be spreading the reviews from bug 1472491 to several people so that everyone can look at their corresponding areas of the code and see what the changes look like.<br><br>Let us know if you have any questions or concerns!<br><br>Also, a note: in a not-so-distant future, the frame scripts are likely to be fully phased out, and once the JS IPDL API is ironed out (Bug 1475415), the messages sent through the message manager will be replaced by real IPC messages.<br><br><br>[1] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1472491" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=1472491</a><br>[2] <a href="https://reviewboard.mozilla.org/r/260636/diff/1#index_header" target="_blank">https://reviewboard.mozilla.org/r/260636/diff/1#index_header</a> <br></div>
_______________________________________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org" target="_blank">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/firefox-dev</a><br>
</blockquote></div>