Skip to content

Commit

Permalink
Resolving browser incompatibities
Browse files Browse the repository at this point in the history
Also update author credits.
  • Loading branch information
IDisposable committed Sep 11, 2024
1 parent d330547 commit e7d6ab0
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ DOLCIMASCOLO (packaging), Zee (ZM) @zm-cttae (many major updates), Joshua Walsh
@nstuyvesant (fixes), King Wang @eachmawzw (CORS image proxy), TMM Schmit @tmmschmit
(useCredentialsFilters), Aravind @codesculpture (fix overridden props), Shi Wenyu @cWenyu
(shadow slot fix), David Burns @davidburns573 and Yujia Cheng @YujiaCheng1996 (font copy
optional)
optional), Julien Dorra @juliendorra (documentation)

## License

Expand Down
4 changes: 2 additions & 2 deletions dist/dom-to-image-more.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dom-to-image-more.min.js.map

Large diffs are not rendered by default.

93 changes: 51 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "dom-to-image-more",
"version": "3.4.3",
"version": "3.4.4",
"description": "Generates an image from a DOM node using HTML5 canvas and SVG",
"main": "dist/dom-to-image-more.min.js",
"devDependencies": {
"chai": "^4.3.10",
"eslint": "^9.9.1",
"eslint": "^9.10.0",
"grunt": "^1.6.1",
"grunt-cli": "^1.5.0",
"grunt-contrib-jshint": "^3.2.0",
Expand Down Expand Up @@ -68,7 +68,8 @@
"Aravind @codesculpture",
"Shi Wenyu @cWenyu",
"David Burns @davidburns573",
"Yujia Cheng @YujiaCheng1996"
"Yujia Cheng @YujiaCheng1996",
"Julien Dorra @juliendorra"
],
"license": "MIT",
"bugs": {
Expand Down
11 changes: 5 additions & 6 deletions src/dom-to-image-more.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,9 @@
}

function isInShadowRoot(value) {
return (
value !== null &&
'getRootNode' in value &&
isShadowRoot(value.getRootNode())
);
// not calling the method, getting the method
if (value === null || value === undefined || value.getRootNode === undefined) return false;
return isShadowRoot(value.getRootNode());
}

function isElement(value) {
Expand Down Expand Up @@ -1123,7 +1121,8 @@
function getCssRules(styleSheets) {
const cssRules = [];
styleSheets.forEach(function (sheet) {
if ('cssRules' in Object.getPrototypeOf(sheet)) {
const sheetProto = Object.getPrototypeOf(sheet);
if (Object.prototype.hasOwnProperty.call(sheetProto, 'cssRules')) {
try {
util.asArray(sheet.cssRules || []).forEach(
cssRules.push.bind(cssRules)
Expand Down

0 comments on commit e7d6ab0

Please sign in to comment.