diff options
| author | 2025-06-30 12:32:56 +0200 | |
|---|---|---|
| committer | 2025-06-30 12:32:56 +0200 | |
| commit | 32146bd8497ac367fc0df8d1cb4f768d9d1b0a6b (patch) | |
| tree | e66097fe12150359368588666c5cd4f2d6bafef2 /p | |
| parent | 7915abd833e1ab7a72ad27b3ec52020ac9ab7051 (diff) | |
Rework #7646: `URLSearchParams` -> `JSON.stringify` (#7704)
* Rework #7646: `URLSearchParams` -> `JSON.stringify`
* Single quotes
* Send `id` as int
Diffstat (limited to 'p')
| -rw-r--r-- | p/scripts/extra.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 2a8bb61a3..59c9453cb 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -238,11 +238,14 @@ function init_update_feed() { e.preventDefault(); faviconExtBtn.disabled = true; fetch(faviconExtBtn.dataset.extensionUrl, { - method: "POST", - body: new URLSearchParams({ + method: 'POST', + headers: { + 'Content-Type': 'application/json; charset=utf-8' + }, + body: JSON.stringify({ '_csrf': context.csrf, 'extAction': 'query_icon_info', - 'id': feed_update.dataset.feedId + 'id': +feed_update.dataset.feedId }), }).then(resp => { if (!resp.ok) { @@ -274,11 +277,14 @@ function init_update_feed() { el.disabled = true; }); await fetch(faviconExtBtn.dataset.extensionUrl, { - method: "POST", - body: new URLSearchParams({ + method: 'POST', + headers: { + 'Content-Type': 'application/json; charset=utf-8' + }, + body: JSON.stringify({ '_csrf': context.csrf, 'extAction': 'update_icon', - 'id': feed_update.dataset.feedId + 'id': +feed_update.dataset.feedId }), }); faviconExtBtn.form.onsubmit = null; |
