Skip to content

Allow apps to inline provide inline js #13570

@rullzer

Description

@rullzer

Right now we have some apps providing small pieces of javascript on each page load. Examples for this are the theming and accessibility. But in the future the mainly loaded js file of the firstrunwizard (nextcloud/firstrunwizard#106) will also be tiny.

In my opinion is makes most sense to inline those tiny scripts as much as possible to get the request count down. Given they are small enough of course.

I would propose a similar approach as we do with the capabilities. We provide an interface (one for JS and one for CSS). And an app can register their stuff to inline easily.

During the rendering of the templates we can then decide on a case by case basis (using some metrics) if we want to inline.

  • Does the browser support CSPv3?
  • Is the script/css not to big?

If not all criteria are met we can still chose to call a route that will simple server the same css/js for an app.

CC: @ChristophWurst @juliushaertl @MorrisJobke @skjnldsv

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions