Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
code review following #185
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Aug 27, 2014
1 parent 7b82f7a commit 7e59e09
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/messaging-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,9 @@ var getPageDetails = function(µb, tabId) {
return r;
}
var prepareRequests = function(requests, hasher) {
var µburi = µb.URI;
var r = [];
var details, pos;
var details, pos, hostname, domain;
for ( var requestURL in requests ) {
if ( requests.hasOwnProperty(requestURL) === false ) {
continue;
Expand All @@ -416,9 +417,14 @@ var getPageDetails = function(µb, tabId) {
hasher.appendStr(requestURL);
hasher.appendStr(details);
pos = details.indexOf('\t');
hostname = µburi.hostnameFromURI(requestURL);
domain = µburi.domainFromHostname(hostname);
if ( domain === '' ) {
domain = hostname;
}
r.push({
type: details.slice(0, pos),
domain: µb.URI.domainFromURI(requestURL),
domain: domain,
url: requestURL,
reason: details.slice(pos + 1)
});
Expand Down

0 comments on commit 7e59e09

Please sign in to comment.