Skip to content

Releases: 1904labs/dom-to-image-more

v3.3.0 Add adjustClonedNode and useCredentialsFilters

14 Feb 18:04
dd1de93
Compare
Choose a tag to compare

What's Changed

  • Expose ability to adjust the cloned node before generating image via adjustClonedNode option. by @IDisposable in #164

  • Add ability to select what external resources require useCredentials via listing URLs in useCredentialsFilters option by @tmmschmit in #156

  • Bumps dev packages up to current

  • Cleaned a bit of lint

adjustClonedNode Hook

You may now specify a call-back to be invoked on each node as we clone them so you can adjust the nodes in any way needed before the conversion. The handler is passed in the options as adjustClonedNode which is a function that gets the original node, the cloned node, and a boolean that says if we've cloned the children already (so you can handle either before or after)

Sample use (with this package source inlined) in this fiddle:

const adjustClone = (node, clone, after) => {
  if (!after && clone.id === 'element') {
    clone.style.transform = 'translateY(100px)';
  }
  return clone;                   
}

const wrapper = document.getElementById('wrapper');
const blob =  domtoimage.toBlob(wrapper, { adjustClonedNode: adjustClone});

useCredentialsFilters URL list

Added a new option useCredentialsFilters which will take a string/Regex array and only share the credentials with the URLs that match an entry in this array. This helps avoid CORS errors.

Full Changelog: v3.2.0...v3.3.0

3.2.0 - Add support for options.corsImg

03 Oct 00:02
c54ddf2
Compare
Choose a tag to compare

Now supports passing an optional options member corsImg that proxies all images through a service proxy.
You configure this option with an object that supplies the proxy handler's url, the method (e.g. 'GET' or 'POST'), a headers collection, and a POST payload data. For the headers and the url, an instance of the exact string '#{cors}' will be replaced by the original url to be fetched.

What's Changed

New Contributors

Full Changelog: v3.1.6...v3.2.0

More rollup bundling fixes

26 Apr 21:39
51bece8
Compare
Choose a tag to compare

Fixes

  • Reformatted to match prettier's settings.
  • Rollup bundling errors Fixes #133

Since rollup sees all imports as modules it replaces this with undefined when evaluating the IFE that dom-to-image-more's source exists as. This leads to errors from rollup that are not actually a problem. Found an incantation that rollup won't break with.

Full Changelog*: v3.1.5...v3.1.6

v3.1.5

26 Apr 01:09
12003de
Compare
Choose a tag to compare

What's Changed

  • fix(ELEMENT_NODE) - avoid error when Node is undefined by @nstuyvesant in #132
  • update resolution to use global, window, and globalThis in that order for getComputedStyle and atob

New Contributors

Full Changelog: v3.1.4...v3.1.5

v3.1.4 - CORS Documentation updates

17 Apr 00:40
b478ee5
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.1.1...v3.1.4

Fix Firefox image issues and reduce console warnings.

23 Mar 18:45
2d2dc63
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.1.0...v3.1.1

Backport fixes from v3.x

23 Mar 20:34
534c72c
Compare
Choose a tag to compare

This backports the main non-breaking fixes from the v3.x branch
Never clone SCRIPT tags
Better table padding #104
Remove mozImageSmoothing #125
Defer image resolution for Firefox tsayen#214

Full Changelog: v2.15.0...v2.16.0

v3.1.0

14 Mar 22:20
6b98256
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.15.0...v3.1.0

Default style copying optional and cleanup unit tests

08 Feb 01:06
9e5aeee
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.0.3-rc.0...v3.0.3-rc.1

v3.0.3-rc.0

01 Feb 23:33
0ef4d0b
Compare
Choose a tag to compare
v3.0.3-rc.0 Pre-release
Pre-release

What's Changed

Full Changelog: v3.0.2-rc.0...v3.0.3-rc.0