kapouer / node-webkitgtk

webkitgtk bindings for :rocket: Node.js
MIT License
189 stars 13 forks source link

cancel 302 redirect #42

Closed oskude closed 4 years ago

oskude commented 8 years ago

is it possible to cancel/stop a 302 redirect?

if not possible, i wonder if cause not "binded" in node-webkitgtk or not implemented upstream?

for example if i load http://google.com i get redirected to http://google.de and node-webkitgtk shows me the google search page. with what i tried:

var WebKit = require("webkitgtk");
WebKit.load("http://google.com", {
    offscreen: false,
    navigation: false
});

what i would like to see is what curl gets:

❱ curl -v google.com
* Rebuilt URL to: google.com/
*   Trying 173.194.112.9...
* Connected to google.com (173.194.112.9) port 80 (#0)
> GET / HTTP/1.1
> Host: google.com
> User-Agent: curl/7.47.1
> Accept: */*
>
< HTTP/1.1 302 Found
< Cache-Control: private
< Content-Type: text/html; charset=UTF-8
< Location: http://www.google.de/?gfe_rd=cr&ei=ZFrHVtydGaWG8Qfu7bj4CA
< Content-Length: 258
< Date: Fri, 19 Feb 2016 18:09:40 GMT
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.de/?gfe_rd=cr&amp;ei=ZFrHVtydGaWG8Qfu7bj4CA">here</A>.
</BODY></HTML>
* Connection #0 to host google.com left intact
kapouer commented 8 years ago

Well, i actively made sure the initial rounds of redirections were handled as "one request", so i guess yes, in principle, it's possible to do that, but some code must be changed in webkitgtk.js / src/webview.cc - maybe even in the extension code. I'm too busy right now to do that, but i'm ok with any PR (with tests). Eventually i'll fix this.

oskude commented 8 years ago

cool, no sweat! i'll poke around :yum:

oskude commented 4 years ago

FWIW, im not following this ticket anymore.

kapouer commented 4 years ago

Anyone's better off using playwright right now ;)