Skip to content
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

Detect if the current URL has a WebDAV share #129

Open
stokito opened this issue Mar 24, 2023 · 2 comments
Open

Detect if the current URL has a WebDAV share #129

stokito opened this issue Mar 24, 2023 · 2 comments

Comments

@stokito
Copy link

stokito commented Mar 24, 2023

Currently if I'm on a page that doesn't have a WebDAV share and executing the bookmarklet then it's executed but as result I have a broken page.

It's fine, but maybe we can change order and first check OPTIONS and only then render the UI. And if the URL doesn't have a DAV header then gracefully say it to a user.

I'm going to implement this for the browser extension #128 but this may be done by the webdav-js itself.

@stokito
Copy link
Author

stokito commented Mar 28, 2023

Also currently the webdav-js loading automatiaclly and renders directory folder. So if the script is added to <head> then loading happening no matter of what.
I need to trigger the loading manualy. The problem is that when I using it from the WebDAV usercript I can't use @require but instead I need to manually create a <script> tag with the library.
While we can @require JS files we need to load manually CSS files. So first I need to load CSS and only then load the JS

@stokito
Copy link
Author

stokito commented Apr 9, 2023

Ok so here I implemented the loader myself:

https://github.com/WebDAVDevs/webdav-browser-extension/blob/master/loadWebdavJs.js

The OPTIONS can't be used because the DAV header is hidden when making a request from JS. So instead I called a PROPFIND Depth:0 and then checking a body.
The entire webdav-js script I wrapped into a function initializeDavUi()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant