Yep, it's quite deliberate that there's no way for an untrusted notebook to run code as soon as it opens. That's exactly the same issue as Office macro viruses: you should be able to open documents without trusting them with arbitrary code execution. For a similar but less obvious reason, untrusted notebooks don't get to load custom CSS: it might be possible to disguise malicious code and trick the user into running it.
CSS displayed by the notebook will affect nbviewer, however - here's an example of a book using that (CSS loaded by the last cell): http://nbviewer.jupyter.org/github/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/blob/master/Chapter1_Introduction/Ch1_Introduction_PyMC3.ipynb On 25 February 2018 at 07:21, Lawrence D’Oliveiro <[email protected]> wrote: > On Wednesday, February 21, 2018 at 9:06:59 PM UTC+13, David Ketcheson > wrote: >> >> >> It seems to me that it would be reasonable to allow notebook metadata to >> specify a CSS file and a JS file to be loaded on startup. >> > > CSS file perhaps, but not JS file. Currently, as far as I’m aware, there > is no facility for automatically executing code on opening a notebook. And > I think it should stay that way. > > -- > You received this message because you are subscribed to the Google Groups > "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jupyter/1720177e-392a-4520-8c67-b977381b4e11%40googlegroups.com > <https://groups.google.com/d/msgid/jupyter/1720177e-392a-4520-8c67-b977381b4e11%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAOvn4qjKfWCrViJMO%2BvTQyOnFdbDs5WihAO1USw%3D3v2YVHVoLQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
