-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guard window
object access for environments which don't have it
#397
Comments
@ccordoui would you accept a PR that fixes this single line preventing Turndown from running in web workers? |
@Radiergummi it will patch the case of the undefined window, unfortunately as we don't have access to DOM in a service worker, it would need more work to be fully functional. I ended up repeating the html to markdown process in all part of my web extension and the service worker only communicate in json. |
Turndown can be used in DOM-less environments without further modification by using a DOM library such as linkedom. |
Met the same issue when trying to use turndown in a service worker |
I have the same issue - I had to fork the library and fix it with:
|
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
[email protected]
for the project I'm working on.I'm running turndown in a macOS app using JavaScriptCore, which is an environment without a
window
object. Turndown works great except for one line where it reference thewindow
object. It was a simple fix to add a guard expression.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: