How to add content to pages using a plugin? I am developing a plugin for Craft 3. And I am trying to add some content to all pages in the CMS using this plugin. How can I do that? Is there a method or class call I can use for this? I am not sure where this is mentioned in the docs either.

Basically I want to add a few lines of HTML, CSS and JS in all the pages of the CMS if my plugin is installed and enabled in that Craft installation. Any ideas, anyone?
If you are able to place a hook tag in all templates then you could register a new template hook method in your plugin.

Twig:

{% hook 'my-custom-hook-name' %}


Your plugin:

Craft::$app-&gt;view-&gt;hook('my-custom-hook-name', function(array &amp;$context) {
    $context['foo'] = 'bar';
    return '&lt;p&gt;Hey!&lt;/p&gt;';
});


For injecting CSS or JS you would use 

\Craft::$app-&gt;getView()-&gt;registerCssFile("file.css");
\Craft::$app-&gt;getView()-&gt;registerJsFile("file.js");


If you can't modify the template files to place a hook tag there you could dynamically generate the markup in your JS file, depending on your use case.