Hi guys sorry if its obvious but I don't know where to start.
I stop using electron for my app to use Tauri,
From my Tauri config , I call my app URL as a webview.
And in my main.js electron file I have an important function that I would like to migrate in Tauri but I don't even know if its possible ..
const electron = require("electron");
const { BrowserWindow, session } = electron;
session.defaultSession.webRequest.onHeadersReceived(
{ urls: ["https://*.MyAPI.com/"] },
(details, callback) => {
if (
details.responseHeaders &&
details.responseHeaders["Set-Cookie"] &&
details.responseHeaders["Set-Cookie"].length &&
!details.responseHeaders["Set-Cookie"][0].includes("SameSite=None")
) {
details.responseHeaders["Set-Cookie"][0] =
details.responseHeaders["Set-Cookie"][0] + "; SameSite=None; Secure";
}
callback({ cancel: false, responseHeaders: details.responseHeaders });
}
);
this function modify headers from requests from an usefull API to could set and get some cookies.