Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
542 views
in Technique[技术] by (71.8m points)

javascript - 电子-从BrowserWindow的loadUrl()检索HTTP响应标头(Electron - Retrieving HTTP response headers from the BrowserWindow's loadUrl())

I'm working on a test project hosted on a pc included in a SSO environment.

(我正在研究一个SSO环境中包含在PC上的测试项目。)

I'm actually pointing to a webpage hosted on a server inside this environment and I need to access the cookies (just got them) and the http headers of the request.

(我实际上指向的是在此环境内的服务器上托管的网页,我需要访问cookie(仅获取它们)和请求的http标头。)

I studied the doc and it seems there isn't a callback function for the loadUrl() method nor an option I can use to get those headers.

(我研究了文档,似乎没有用于loadUrl()方法的回调函数,也没有可以用来获取这些标头的选项。)

link for the reference

(参考链接)

https://electronjs.org/docs/api/browser-window

(https://electronjs.org/docs/api/browser-window)

loadUrl has a second optional parameter that is defined as an Electron.loadURLOption but it doesn't seem to be helpful

(loadUrl具有第二个可选参数,该参数定义为Electron.loadURLOption,但似乎没有帮助)

interface LoadURLOptions {
    /**
     * An HTTP Referrer url.
     */
    httpReferrer?: (string) | (Referrer);
    /**
     * A user agent originating the request.
     */
    userAgent?: string;
    /**
     * Extra headers separated by "
"
     */
    extraHeaders?: string;
    postData?: (UploadRawData[]) | (UploadFile[]) | (UploadBlob[]);
    /**
     * Base url (with trailing path separator) for files to be loaded by the data url.
     * This is needed only if the specified url is a data url and needs to load other
     * files.
     */
    baseURLForDataURL?: string;
}

I'd appreciate any kind of help, thanks

(我将不胜感激,谢谢)

  ask by sarbuLopex translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...