84 |
sub html { |
sub html { |
85 |
my ( $self, $req ) = @_; |
my ( $self, $req ) = @_; |
86 |
|
|
87 |
my $body; |
my $body = $self->get_page; |
|
|
|
|
if ( $self->uri->path =~ m{/__bookmarklet} ) { |
|
|
my $js = read_file( 'static/xpath.js' ); |
|
|
$js =~ s{//.*}{}gm; # remove comments so that compaction below doesn't screw code |
|
|
$js =~ s/\s\s+/ /gs; |
|
|
$req->print(qq{ |
|
|
Drag this <a href="javascript:void($js);">bookmarklet</a> to bookmark toolbar or menu to install XPATH inspector |
|
|
}); |
|
|
return; |
|
|
} |
|
|
|
|
|
$body .= $self->get_page; |
|
88 |
|
|
89 |
# strip full hostname |
# strip full hostname |
90 |
my $url = $self->uri; |
my $url = $self->uri; |