Skip to content

Commit

Permalink
playwright args
Browse files Browse the repository at this point in the history
  • Loading branch information
PaleNeutron committed Jul 16, 2024
1 parent 562540d commit 77eb14e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dataframe_image/_pandas_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def export(
fontsize=fontsize,
encode_base64=False,
limit_crop=False,
device_scale_factor=(1 if dpi == None else dpi / 100.0),
device_scale_factor=(1 if dpi is None else dpi / 100.0),
use_mathjax=use_mathjax,
).run
else:
Expand Down
4 changes: 2 additions & 2 deletions dataframe_image/converter/browser/playwright_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def screenshot(self, html):
channels = ["chrome", "msedge", None]
for c in channels:
try:
browser = p.chromium.launch(channel=c)
browser = p.chromium.launch(channel=c, args=["--disable-web-security"])
break
except Error:
pass
Expand All @@ -29,7 +29,7 @@ def screenshot(self, html):
"Or install it by `playwright install chromium`"
)

context = browser.new_context(device_scale_factor=self.device_scale_factor)
context = browser.new_context(device_scale_factor=self.device_scale_factor, bypass_csp=True)
page = context.new_page()
page.set_content(self.get_css() + html)
if self.use_mathjax:
Expand Down

0 comments on commit 77eb14e

Please sign in to comment.