Fix issue prevent adding urls via Chromium browsers.

Cette révision appartient à :
arabcoders
2025-05-28 15:59:28 +03:00
Parent bf8c0f3d44
révision 45bb4e2303
2 fichiers modifiés avec 11 ajouts et 5 suppressions
+8 -2
Voir le fichier
@@ -1,6 +1,7 @@
# A YTPTube extension
This extension can be used in `Chrome/Chromium browsers` and `Firefox` to add URLs to [YTPTube](https://github.com/arabcoders/ytptube) instance.
This extension can be used in `Chrome/Chromium browsers` and `Firefox` to add URLs
to [YTPTube](https://github.com/arabcoders/ytptube) instance.
## Screenshots
@@ -9,8 +10,13 @@ This extension can be used in `Chrome/Chromium browsers` and `Firefox` to add UR
## Installation from store
- Install from [Firefox](https://addons.mozilla.org/en-US/firefox/addon/ytptube-extension/)
- Install from [Chrome/Chromium Browsers](https://chromewebstore.google.com/detail/ytptube-extension/kiepfnpeflemfokokgjiaelddchglfil)
- Install
from [Chrome/Chromium Browsers](https://chromewebstore.google.com/detail/ytptube-extension/kiepfnpeflemfokokgjiaelddchglfil)
## Usage
Configure the extension to point to your YTPTube instance in the extension options page.
## For issues
To report issues, please use the [GitHub issues page](https://github.com/arabcoders/ytptube/issues) at this repository.
+3 -3
Voir le fichier
@@ -70,15 +70,15 @@ const sendRequest = async (path, data) => {
const url = new URL(instanceUrl);
url.pathname = path;
console.debug(`Sending to '${instanceUrl}'.`, data, headers.length > 0 ? 'with auth header' : 'without auth header');
let opts = {method: data.length > 0 ? 'POST' : 'GET', headers: headers};
let opts = {method: Object.keys(data).length > 0 ? 'POST' : 'GET', headers: headers};
if (data) {
opts.headers['Content-Type'] = 'application/json';
opts.body = JSON.stringify(data);
}
console.debug(`Sending to '${instanceUrl}'.`, opts, headers.length > 0 ? 'with auth header' : 'without auth header');
const req = await fetch(url, opts);
return {status: req.status, statusText: req.statusText, data: req};
};