Commit Graph

35 Commits (master)

Author SHA1 Message Date
Zack Weinberg 50ae50e871 Add a command-line option --local-urls={true,false}
The default is 'true'.  When set 'false', file: and qrc: URLs are
treated as invalid (unknown scheme) rather than opening local files,
as requested in issue #12752.

In order to test this, I added a mechanism to test/run-tests.py
allowing individual tests to be annotated with command-line
options to pass to phantomjs or the script.
2014-11-21 15:51:35 +00:00
Vitaliy Slobodin 5528d75c9d Network request header manipulation
Issue: https://github.com/ariya/phantomjs/issues/11299 (#11299)

User should be able  to manipulate HTTP headers per each network request, not only using global setting page.customHeaders.
2013-05-13 22:48:58 -07:00
Tom Aizenberg 52883ced68 WebPage: network timeout setting.
Fixes issue #11129.

https://github.com/ariya/phantomjs/issues/11129
2013-03-19 22:57:26 -07:00
Vitaliy Slobodin 212e4b7cd9 Reworked api for canceling network requests. Added experimental API for changing the url of the network request.
Issue:
http://code.google.com/p/phantomjs/issues/detail?id=539

Stub
2013-02-24 09:00:07 -08:00
Vitaliy Slobodin 6d81933941 Pass the resource URL to the resourceError handler.
http://code.google.com/p/phantomjs/issues/detail?id=997
2013-01-21 21:42:10 -08:00
Vitaliy Slobodin 09e929d599 Allow to abort network requests.
Issue: http://code.google.com/p/phantomjs/issues/detail?id=230
2013-01-04 23:39:23 -08:00
Vitaliy Slobodin fd700b0702 New WebPage callback: onResourceError.
This callback is invoked when the WebPage was unable to request the resource

Issue: http://code.google.com/p/phantomjs/issues/detail?id=954
2013-01-04 21:24:30 -08:00
Vitaliy Slobodin b834f2a590 Allow to specify the SSL protocol for a requests.
http://code.google.com/p/phantomjs/issues/detail?id=174
2012-10-29 06:36:08 -07:00
Johan Sköld b7ca845327 Gave page a maxAuthAttempts setting.
QtWebKit normally loops infinitely trying to authenticate when it receives a
401 code, preventing all callbacks (onLoadFinished, onResourceReceived, etc).
This commit changes it to only try a set amount of times before aborting.

https://code.google.com/p/phantomjs/issues/detail?id=826
2012-10-24 00:02:59 -07:00
Ivan De Marino bd21373732 Redesign the Cookies API
Addresses [Issue #761](http://code.google.com/p/phantomjs/issues/detail?id=761).

This is a squash of 5 commits.

1. Complete reimplementation of the CookieJar and the Cookie API - Part 1.

The save/load mechanism is inspired by the Qt Demo "browser".
More info: http://doc.qt.nokia.com/4.7-snapshot/demos-browser.html

2. Making the CookieJar a singleton.

We need to have multiple NetworkAccessManager to monitor the network activity of the page,
but we also need to maintain 1 CookieJar: in this way we now have a shared bucket of Cookies.

3. Exposing the new Cookies API to the JS space.

* Updated the completions.
* Ensured backward compatibility of the API.
* It's now possible to "phantom.cookieEnabled = false" to disable cookies completely.
* New methods: addCookie, deleteCookie, clearCookies

4. Provided some internal Doc for the new Cookies API

5. Ensuring the "page.deleteCookie(name)" method works only if a cookie name is given.
2012-09-07 00:03:03 -07:00
neraliu 4e1735c899 Implement in-memory cookies storage for CookieJar.
http://code.google.com/p/phantomjs/issues/detail?id=603

Squashed commit of the following:

commit 2087320b9549aa2bba53d73e8a681133e5b4fe96
Author: neraliu <neraliu@gmail.com>
Date:   Sat Jul 14 20:55:17 2012 +0800

    Improve the readability of the function CookieJar::setCookies and CookieJar::cookies.

commit 7ef076e9df488c8f82863cb9c6e31350af5eaad8
Author: neraliu <neraliu@gmail.com>
Date:   Fri Jul 13 18:08:07 2012 +0800

    Fix the indentation problem in the file cookiejar.cpp.
    Remove some commented code segment in cookiejar.cpp.

commit d8fd7f49eb1ba0fb47c27aec9b3dcd36ca14f301
Author: neraliu <neraliu@gmail.com>
Date:   Fri Jul 13 18:04:41 2012 +0800

    Simplify the implementation of CookieJar::setCookiesFromUrl to use the same security policy of QNetworkCookieJar::setCookiesFromUrl in QtWebkit

commit f5e34d2b787bb9714c45a8ad0baff8b5282d3249
Author: neraliu <neraliu@gmail.com>
Date:   Fri Jul 13 17:20:38 2012 +0800

    Simplify the implementation of CookieJar::cookiesForUrl to use the same security policy of QNetworkCookieJar::cookiesForUrl in QtWebkit.

commit 5b10e3788cce7bd69bb71c7ee06f0b49e1e92228
Author: Nera Liu <neraliu@gmail.com>
Date:   Mon Jun 25 10:56:32 2012 +0800

    Remove the clearAllCookies() api by allowing to clear cookies by page.cookies = [] Javascript syntax.

commit a1f12b2913b6f3a3f11a2d22b5eb8c35bf62bf48
Author: Nera Liu <neraliu@gmail.com>
Date:   Sun Jun 24 21:48:49 2012 +0800

    Implement in-memory cookies storage for CookieJar allowing dynamic cookie manipulation via Javascript for issue 603.

    Add sanity check for the in-memory cookies storage for CookieJar.

    http://code.google.com/p/phantomjs/issues/detail?id=603
2012-09-03 04:30:49 -07:00
Nera Liu 7919387c71 Add WebPage.setCookies and WebPage.cookies apis for the issue 354.
Add sanity check for the cookies api in test/webpage-spec.js.

http://code.google.com/p/phantomjs/issues/detail?id=354
2012-06-14 00:43:20 -07:00
david cd0567e8cd Add support for HTTP request headers modification.
http://code.google.com/p/phantomjs/issues/detail?id=77
2012-02-19 00:49:28 -08:00
Ariya Hidayat 76de868075 Make HTTP authentication as page settings.
http://code.google.com/p/phantomjs/issues/detail?id=45
2011-09-16 17:34:02 -07:00
Ariya Hidayat 7a9b6b4fec Clean-up WebPage constructor.
We shall just pass the Config instance, that's cleaner and less messy.

This is a preparation step for
http://code.google.com/p/phantomjs/issues/detail?id=190
2011-09-14 21:47:36 -07:00
Ariya Hidayat 962f99fa77 Fix typo in the method name. 2011-09-06 17:00:55 -07:00
Ariya Hidayat 07c6eb81f5 Sort include files alphabetically. 2011-09-06 16:37:54 -07:00
Ariya Hidayat 3dc9fe53a0 Disk cache object is private for network access. 2011-09-06 16:36:23 -07:00
Ariya Hidayat c0e179d59e Do not manage object lifetime, rely on Qt for that. 2011-09-06 16:35:19 -07:00
Ariya Hidayat cebe64ec31 Config to limit the disk cache size.
Based on the previous patch at https://github.com/ariya/phantomjs/pull/144.

http://code.google.com/p/phantomjs/issues/detail?id=220
2011-09-06 16:33:11 -07:00
Ariya Hidayat 7aa5ec5347 Do not use empty string literal for the default parameter. 2011-09-06 16:01:19 -07:00
mintbridge af71868c23 add basic http auth support to networkaccessmanager, and add the ability to pass the auth credentials in from the command line 2011-09-02 16:35:58 +01:00
Ivan De Marino d8d88a3894 Added "Copyright..." line to files on which I worked on.
I tried to also add/remove based on the git history.
2011-08-31 16:29:40 +01:00
Joe Gornick 578aa6c236 Updated the network access manager to use a proxied reply so the response bodies can be captured. 2011-08-14 03:41:39 -05:00
Erik Dubbelboer b1d947dd51 added persistent cookie support 2011-07-19 19:32:42 +02:00
Ariya Hidayat 555f80c899 onResourceReceived with stage=start should fire only once.
We detect if stage=start has been fired before. If yes, no need to
fire again, thus making the event is associated with the very
first byte received for the given resource.
2011-06-08 07:57:51 -07:00
Ariya Hidayat 5b2fdca640 Add a unique id to associate resource request and receive. 2011-06-08 07:54:28 -07:00
Ariya Hidayat 1cae77a3e0 Add 'onResourceReceived' event, fired when resource is being received.
This is now being used in the netsniff.js example.
2011-06-08 01:10:00 -07:00
Ariya Hidayat 8722399c0a Add "onResourceRequested" event, fired when request is started.
To see how this is being used, see the new examples/netsniff.js.

http://code.google.com/p/phantomjs/issues/detail?id=2
2011-06-07 00:06:08 -07:00
Peter Jihoon Kim 57f525a78a added option: --ignore-ssl-errors=[yes|no] 2011-04-29 16:32:40 +08:00
Jon Turner e82619df4d Removed old function declaration 2011-04-12 18:10:53 +01:00
Jon Turner 0e1e5071fb Added option for disk cache use 2011-04-12 15:21:09 +01:00
Ivan De Marino be72a29c9f Propagated License Headers. 2011-04-09 18:34:04 +01:00
Ivan De Marino 71e0612ccc Added analysis of the HTTP Reply in the NetworkAccessManager. 2011-04-09 18:26:04 +01:00
Ivan De Marino 6ec8b3b669 New "shim" Network Access Manager, new 'browsermode' example and more.
The new Network Access Manager currently is designed to do just logging:
- logs HTTP Method type
- logs HTTP Destination URL

The new 'browsermode':
It's in "/examples" and make PhantomJS do just a call to "open(url)".
It has a companion shell script to help with the task.

Also, improvement for Message Handler:
messages are now prefixed with ISO Datetime.
2011-04-09 18:22:52 +01:00