Open stokito opened 1 year ago
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
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()
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.