Permalink
Browse files

Merge pull request #68 from duckduckgo/zaahir/duckpan-updates

More minor fixes
  • Loading branch information...
2 parents ec4fdf7 + acedb84 commit bd93d812c5e282ff93df803eeb33c91eba4fd9e3 @russellholt russellholt committed May 23, 2014
Showing with 7 additions and 2 deletions.
  1. +1 −1 lib/App/DuckPAN.pm
  2. +6 −1 lib/App/DuckPAN/Cmd/Server.pm
View
2 lib/App/DuckPAN.pm
@@ -21,7 +21,7 @@ use Term::ReadLine;
use Carp;
use Encode;
use Path::Class;
-use File::Path qw(remove_tree);
+#use File::Path qw(remove_tree);
our $VERSION ||= '9.999';
View
7 lib/App/DuckPAN/Cmd/Server.pm
@@ -225,13 +225,18 @@ sub change_html {
# ie <link href="/d123.js"> becomes <link href="/?duckduckhack_js=1">
# Also rewrite relative links to hostname
+ # Temp Fix: Force ignore of d.js & duckduck.
+ # This logic needs to be improved!
+
for (@script) {
if (my $src = $_->attr('src')) {
- if ($src =~ m/^\/(d\d+|duckduck)\.js/) {
+ if ($src =~ m/^\/(dpan\d+|duckpan_dev)\.js/) {
$_->attr('src','/?duckduckhack_js=1');
} elsif ($src =~ m/^\/(g\d+|duckgo_dev)\.js/) {
$_->attr('src','/?duckduckhack_templates=1');
+ } elsif ($src =~ m/^\/(d\d+|duckduck)\.js/) {
+ $_->attr('src','/?duckduckhack_ignore=1');
} elsif (substr($src,0,1) eq '/') {
$_->attr('src','http://'.$self->hostname.''.$_->attr('src'));
}

0 comments on commit bd93d81

Please sign in to comment.