fanglingsu/vimb — pull request #143 by semarie (2014-11-08 13:08:40+00:00)
Title: allow/disallow page-request opening of new window

Hi Daniel,

I add a new setting to control opening new window made by page request
(window.open javascript or target="_blank"). The user request opening of
new window isn't changed (tabopen, hints, ...).

The implementation split `VB_TARGET_NEW` (used in `vb_load_uri`) in `VB_TARGET_NEW_PAGE_REQUEST` and `VB_TARGET_NEW_USER_REQUEST`.

Any user action that performed `VB_TARGET_NEW` is converted to
`VB_TARGET_NEW_USER_REQUEST`, and others to `VB_TARGET_NEW_PAGE_REQUEST`.

The behaviour of `VB_TARGET_NEW_USER_REQUEST` is the same as `VB_TARGET_NEW`.
The behaviour of `VB_TARGET_NEW_PAGE_REQUEST` is controlled by the setting. If `allow-page-request-open-window` is `on` (the default), the behaviour is same as `VB_TARGET_NEW`, else behaviour is like `VB_TARGET_CURRENT`.

Use case: I use always `cookie-timeout=0`, in order to keep session cookies in memory, and don't share session cookies across vimb instances. But as result, when a site open a new window, the session cookie isn't here. The setting could mitigate the problem by disallowing a site to open a new window, but to force it to use the current instance.