-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add disable_scripts
non-global option
#268
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine by me, but I would add a note in the docs of the global disable_scripts option to mention that it is only the default, and that it can be overwritten by the local one
Hey @osbre, besides the added note in the docs @MaeIsBad already suggested, could you add tests for setting up both global and local options at the same time, so that we have cases where the local option will override the global one. I think then it is good to go for my point of view. Cheers |
Thanks, @andreasknoepfle and @MaeIsBad, I've added the requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks. good to me. One mix format
and I can merge :)
@andreasknoepfle the "Lint" workflow fails with the message that one file wasn't formatted. I'm thinking - is it because I used the latest Elixir version to run |
@osbre The [edit] hijacked #214 to track the proper solution |
Hi @osbre Sorry for arriving so late to bring up the following issues. Was away for a few weeks and only yesterday thought about it a bit more.
That said, I also wonder the PR in general, as it breaks the current global vs. non-global option setup. The original idea was to perform as much work as possible in the session initialization, aiming at lower "redundant" work per print job and hence improving performance. Not sure whether the performance benefit is measureable at all, but at least that has been the basic reasoning behind which options are global and which are per-job and this PR puts an end to this "practice", yet only for one of the relevant options - At the same time, users already can have spawn multiple (named) ChromicPDF supervisor instances. Which allows them to, for example, have separate This makes me wonder, whether we should rather invest in this area, e.g. by improving documentation of |
This option got removed in #168, my PR brings it back and makes it possible to use both ways.
I personally have a use case for disabling scripts not globally, but for particular pages. Puppeteer and others also have this option. Would love to see it in this (best-in-class) Elixir library
Closes #267