[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: Changing a user agent string

In [emacs-w3m:12878]
On Wed, 17 Jan 2018 22:17:36 -0500, Boruch Baum wrote:
> On 2018-01-18 10:29, Katsumi Yamaoka wrote:
>> Thanks.  I verified it works fine.

> It's not showing up when I perform a `cvs update'.

Installed.  (I thought you will post the next version soon. ;-p)


> I hard-coded one of the entries in
> the `completing-read' collection to be the user's default user-agent
> string and even labeled it that way. The end result is more
> user-friendly than exists by default in any other browser with which I'm
> familiar.

Good.  After all, the one we really need might be only
the `permanent' feature even if it should be used with care.
I started to think so.

>> In addition, such a page might require the user-agent faking for
>> also visiting links in it.  In such a case, the user-agent value
>> will need to be semi-permanent.  I mean making it session-local,
>> but if impossible buffer-local.  Oh, that might only be able to
>> make the code dirty.

> Both ideas sound reasonable, for the reason you mention.

> I'm not sure of everything that might be entailed to properly support
> `session-local' user-agent strings. I suspect it would not be messy, but
> it would need research, and at the very least would need to modify the
> data structure and functions that save and restore session data.

Oops.  I overlooked saved ones.

> OTOH, setting the variable as `buffer-local' seems straightforward. The
> function, when called directly interactively would prompt the user to
> choose whether to apply the setting globally, or just for the current
> buffer. If you're certain you want that, let me know.

I think the `buffer-local' is good enough and easy to implement.

>> Another idea is to introduce an alist that holds a list of a url-
>> regexp and a user-agent pairs.  It overrides the default user-agent
>> if a regexp matches the url to visit.

> This is a very nice idea. A complexity would be that there would need to
> be a way to manually over-ride the alist ...

It would not be wasteful even if such one exists together with
the manually changing feature.


> For me, the current value of `w3m-add-referer` is:

>   ("\\`http:" . "\\`http://\\(?:localhost\\|127\\.0\\.0\\.1\\)/")

> The change would be?

>   ("\\`https?:" . "\\`https?://\\(?:localhost\\|127\\.0\\.0\\.1\\)/")

Exactly.  Thanks.