Releases: 1904labs/dom-to-image-more
v3.3.0 Add adjustClonedNode and useCredentialsFilters
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 inuseCredentialsFilters
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
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
- Fix typo by @nadavspi in #155
- Add corsImg support hand merged from tsayen#329
New Contributors
- @nadavspi made their first contribution in #155
- @eachmawzwr first contribution in copied from tsayen#329
Full Changelog: v3.1.6...v3.2.0
More rollup bundling fixes
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
What's Changed
- fix(ELEMENT_NODE) - avoid error when Node is undefined by @nstuyvesant in #132
- update resolution to use
global
,window
, andglobalThis
in that order forgetComputedStyle
andatob
New Contributors
- @nstuyvesant made their first contribution in #132
Full Changelog: v3.1.4...v3.1.5
v3.1.4 - CORS Documentation updates
What's Changed
- Cleanup the package and add publish action by @IDisposable in #126
- Added alternative solutions to fix #14 in README.md by @emrecoban in #129
New Contributors
- @emrecoban made their first contribution in #129
Full Changelog: v3.1.1...v3.1.4
Fix Firefox image issues and reduce console warnings.
What's Changed
- Workaround for Firefox bug (fixes #123) by @JoshuaWalsh in #124
- PR Cleanups by @IDisposable in #125
Full Changelog: v3.1.0...v3.1.1
Backport fixes from v3.x
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
What's Changed
- Work on table padding issue #95 by @IDisposable in #104
- Catch up to master's clone-cleanups by @IDisposable in #107
- Better default styles computation. by @IDisposable in #108
- Add support for Shadow DOM (ShadowRoot) by @zm-cttae in #101
- Ensure the sandbox iframe is discarded. by @IDisposable in #112
- Quirks mode regression fix by @IDisposable in #113
- Add option to enable / disable the copying of default styles by @AndoniZubimendi in #114
- Add documentation about the option to disable the copying of default styles by @AndoniZubimendi in #115
- Cleanup unit testing by @IDisposable in #116
- Support bare text nodes by @IDisposable in #117
- Release 3.1.0 by @IDisposable in #122
New Contributors
- @AndoniZubimendi made their first contribution in #114
Full Changelog: v2.15.0...v3.1.0
Default style copying optional and cleanup unit tests
What's Changed
- Add option to enable / disable the copying of default styles by @AndoniZubimendi in #114
- Add documentation about the option to disable the copying of default styles by @AndoniZubimendi in #115
- Cleanup unit testing by @IDisposable in #116
New Contributors
- @AndoniZubimendi made their first contribution in #114
Full Changelog: v3.0.3-rc.0...v3.0.3-rc.1
v3.0.3-rc.0
What's Changed
- Quirks mode regression fix by @IDisposable and @meche-gh in #113
Full Changelog: v3.0.2-rc.0...v3.0.3-rc.0