-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
# webdav-browser-extension | ||
Chrome extension to browse a URL as a WebDAV share | ||
Chrome extension to browse a URL as a WebDAV share. | ||
|
||
It just uses the https://github.com/dom111/webdav-js | ||
But instead of a bookmarklet you can use it as an extension. | ||
|
||
## TODO and known problems | ||
* You need a dir listing enabled otherwise it will fail due to a bug https://github.com/dom111/webdav-js/issues/123 | ||
* Remember folders that should be viewed as dav | ||
* Use a state as for Dark Reader or tutorial.focus-mode. The current popup solution is lame. | ||
* Autodetect a webdav share: | ||
* On 403 error we can try a PROPFIND | ||
* `Alt-Svc: dav` header https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Svc | ||
* Option to load the webdav-js directly from CDN with a latest version | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "WebDAV Browser", | ||
"description": "Browse a URL as a WebDAV share", | ||
"version": "1.0", | ||
"manifest_version": 3, | ||
"icons": { | ||
"48": "icons8-dav-50px.png" | ||
}, | ||
"permissions": [ | ||
"activeTab", | ||
"scripting" | ||
], | ||
"host_permissions": [ | ||
"http://*/*", | ||
"https://*/*" | ||
], | ||
"action": { | ||
"default_popup": "popup.html", | ||
"default_icon": "icons8-dav-50px.png" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<html> | ||
<script src="popup.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
chrome.tabs.query({ | ||
currentWindow: true, | ||
active: true | ||
}, (tabs) => { | ||
if (tabs.length !== 1) { | ||
return | ||
} | ||
insertWebdavJs(tabs[0]) | ||
}) | ||
|
||
function insertWebdavJs(tab) { | ||
chrome.scripting.executeScript({ | ||
target: {tabId: tab.id}, | ||
func: clearBody, | ||
}) | ||
chrome.scripting.executeScript({ | ||
target: {tabId: tab.id}, | ||
files: ['webdav-min.js'] | ||
}) | ||
chrome.scripting.insertCSS({ | ||
target: {tabId: tab.id}, | ||
files: ['style-min.css'], | ||
}) | ||
} | ||
|
||
function clearBody(){ | ||
console.log("Clear existing body if any") | ||
document.body.innerHTML = "" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.