Fix issue prevent adding urls via Chromium browsers.
Cette révision appartient à :
+8
-2
@@ -1,6 +1,7 @@
|
|||||||
# A YTPTube extension
|
# 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
|
## Screenshots
|
||||||
|
|
||||||
@@ -9,8 +10,13 @@ This extension can be used in `Chrome/Chromium browsers` and `Firefox` to add UR
|
|||||||
## Installation from store
|
## Installation from store
|
||||||
|
|
||||||
- Install from [Firefox](https://addons.mozilla.org/en-US/firefox/addon/ytptube-extension/)
|
- 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
|
## Usage
|
||||||
|
|
||||||
Configure the extension to point to your YTPTube instance in the extension options page.
|
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.
|
||||||
@@ -70,15 +70,15 @@ const sendRequest = async (path, data) => {
|
|||||||
const url = new URL(instanceUrl);
|
const url = new URL(instanceUrl);
|
||||||
url.pathname = path;
|
url.pathname = path;
|
||||||
|
|
||||||
console.debug(`Sending to '${instanceUrl}'.`, data, headers.length > 0 ? 'with auth header' : 'without auth header');
|
let opts = {method: Object.keys(data).length > 0 ? 'POST' : 'GET', headers: headers};
|
||||||
|
|
||||||
let opts = {method: data.length > 0 ? 'POST' : 'GET', headers: headers};
|
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
opts.headers['Content-Type'] = 'application/json';
|
opts.headers['Content-Type'] = 'application/json';
|
||||||
opts.body = JSON.stringify(data);
|
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);
|
const req = await fetch(url, opts);
|
||||||
return {status: req.status, statusText: req.statusText, data: req};
|
return {status: req.status, statusText: req.statusText, data: req};
|
||||||
};
|
};
|
||||||
|
|||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur