0.3.0 • Published 2 years ago

dom-with-styles v0.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Get the current DOM with the styles

Objective

The goal of this function is to provide a simple way to extract the DOM of a webpage that can be contained in a single string. We rely on the SingleFile engine to capture the page in a single page.

How to use it?

getCurrentDomWithStyles does not take any arguments and returns a Promise that when resolved contains a string containing the entire dom with all the style elements.

Example of usage:

    document.addEventListener('readystatechange', event => {
        domWithStyles.getContent().then(function (dom) {
            console.log(dom);
        });
    });

In this example the script is waiting for the page to be loaded, and then displays the computed current dom with styles in the console.

How to build it

  1. Move to the root of the project
  2. Run npm build.
  3. A browsified version is created at <ROOT>/dist/domWithStyles.bundle.js
0.3.0

2 years ago

0.2.0

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago