Subject: | patch for <base href> related bugs. |
The soon-to-be attached patch fixes two "BASE HREF" related bugs in ::Shell. 22:
1. It appears that if any <BASE tag was present, adding a BASE HREF was skipped. This would do the wrong thing in the case where a <BASE tag was used for something else besides HREF.
2. The <BASE tag was added at end the of the <HEAD> area. This means that any CSS links declared in the HEAD would not be handled properly. A test case of this is my homepage: http://mark.stosberg.com/
To address both of these, I used HTML::TokeParser::Simple to manipulate the HTML, which should be a better job than simple regexp matching. It adds the BASE HREF to the very top of the HEAD area, and only skips adding it if a tag is found that is BASE with an HREF attribute.
This module will need to be added to the PREREQ_PM list.
The patch also fixes what I consider a documentation glitch. I was wondering my my .mechanizerc file wasn't being read. It was because the example script users "rcfile =>undef". To me, it seems a better default to have the .mechanizerc file be read.
In testing, I noticed that if sync_browser dies, the shell dies. Maybe some additional "evals" are needed somewhere. I didn't try to fix that. :)