Make request identical to real requests
This commit is contained in:
parent
776b0afdab
commit
d4c8835e9b
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "not-a-rescheduler",
|
"name": "not-a-rescheduler",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"permissions": [ "storage", "tabs", "activeTab", "notifications", "declarativeContent" ],
|
"permissions": [ "storage", "tabs", "activeTab", "notifications", "declarativeContent" ],
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -206,8 +206,16 @@ async function getConsulates() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getAvailableDates(consulateId) {
|
async function getAvailableDates(consulateId) {
|
||||||
let uri = window.location.pathname + `/days/${consulateId}.json?appointments[expedite]=false`
|
let addressUri = window.location.pathname + `/address/${consulateId}`
|
||||||
let dates = fetch(uri, { headers: { "x-requested-with": "XMLHttpRequest" }})
|
fetch(addressUri, { headers: { "x-requested-with": "XMLHttpRequest" } })
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
|
||||||
|
let datesUri = window.location.pathname + `/days/${consulateId}.json?appointments[expedite]=false`
|
||||||
|
let dates = fetch(datesUri, { headers: {
|
||||||
|
"x-requested-with": "XMLHttpRequest",
|
||||||
|
"accept": "application/json, text/javascript, */*; q=0.01",
|
||||||
|
// "cache-control": "no-cache",
|
||||||
|
}})
|
||||||
.then(d => d.json())
|
.then(d => d.json())
|
||||||
.catch(async e => {
|
.catch(async e => {
|
||||||
await handleHttpError(e);
|
await handleHttpError(e);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user