Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d701701e6 | |||
| 77c68dbe83 |
+14
-1
@@ -131,7 +131,17 @@ async function fetchXhr2(origin, phpsessid, actionId) {
|
||||
async function fetchFicheHtml(origin, phpsessid, formLink) {
|
||||
const url = `${origin}/index.php?${formLink}&PHPSESSID=${encodeURIComponent(phpsessid)}`;
|
||||
console.log("[bg] fetchFicheHtml →", url.substring(0, 120));
|
||||
const r = await fetch(url, { credentials: "include" });
|
||||
// v5.0.8 : EasyVista retourne maintenant un <script> de redirection si on
|
||||
// fait la requête sans Referer. Probablement une protection CSRF ajoutée
|
||||
// récemment. On ajoute un Referer qui simule une navigation depuis la
|
||||
// page principale du planning.
|
||||
const r = await fetch(url, {
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Referer": `${origin}/index.php?eventName=HelpDesk_PlanningItem`,
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
});
|
||||
if (!r.ok) {
|
||||
const err = new Error("HTTP " + r.status);
|
||||
err.kind = classifyHttpStatus(r.status);
|
||||
@@ -140,6 +150,9 @@ async function fetchFicheHtml(origin, phpsessid, formLink) {
|
||||
}
|
||||
const html = await r.text();
|
||||
console.log("[bg] fiche status =", r.status, "| taille =", html.length);
|
||||
if (html.length < 500) {
|
||||
console.warn("[bg] ⚠ fiche très courte, contenu =", JSON.stringify(html));
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Planification",
|
||||
"version": "5.0.6",
|
||||
"version": "5.0.8",
|
||||
"description": "Vue claire et rapide du planning des techniciens EasyVista. Regroupe interventions et réservations par tech, affiche horaires, contact, lieu, catégorie et statut en un coup d'œil.",
|
||||
"permissions": ["activeTab", "scripting", "storage", "tabs", "alarms"],
|
||||
"host_permissions": [
|
||||
|
||||
Reference in New Issue
Block a user