From 68db4eeb4a32cc238a3a610d8ea38eef61a7d45e Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Tue, 4 Oct 2016 11:57:22 +0800 Subject: [PATCH] fix endTime issue in chrome.history.search --- assets/js/details.js | 10 +++++++--- manifest.json | 6 +++--- package.sh | 5 +++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/assets/js/details.js b/assets/js/details.js index e7b6219..34d48a6 100644 --- a/assets/js/details.js +++ b/assets/js/details.js @@ -1,7 +1,10 @@ -function showHistory(histories) { +function showHistory(histories, start, end) { var details = $("#details"); histories = _.sortBy(histories, "lastVisitTime"); for(var i=0; i end) { + continue; + } var title = histories[i].title || histories[i].url; var row = [ ``, @@ -19,13 +22,14 @@ $(function () { $("#currentDay").html(currentDay); var start = moment(currentDay, SHOW_FORMAT); var end = moment(currentDay, SHOW_FORMAT).add('1', 'day'); - console.log(start.format(SHOW_FORMAT_SEC), end.format(SHOW_FORMAT_SEC)) + // Even if set endTime, there are still some items beyond endTime. bug ?? + // so filter again in showHistory chrome.history.search({ text: "", startTime: start.valueOf(), endTime: end.valueOf(), maxResults: MAX_RESULTS }, (histories) => { - showHistory(histories); + showHistory(histories, start.valueOf(), end.valueOf()); }); }) diff --git a/manifest.json b/manifest.json index d1dd688..dc1c72c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { - "name": "Advanced history", - "version": "1.2", + "name": "Advanced History", + "version": "1.3", "description": "Get a better sense of browsing history", "homepage_url": "https://github.com/jiacai2050/better-history", "browser_action": { @@ -11,7 +11,7 @@ "64": "assets/img/64.png", "128": "assets/img/128.png" }, - "default_title": "Better History" + "default_title": "Advanced History" }, "icons": { "16": "assets/img/16.png", diff --git a/package.sh b/package.sh index 8e22d03..9419c6d 100755 --- a/package.sh +++ b/package.sh @@ -2,8 +2,9 @@ cd $(cd `dirname $0`; pwd) -ZIP_FILE="/tmp/advanced-history.zip" +set -x +ZIP_FILE="${HOME}/Desktop/advanced-history.zip" if [[ -f $ZIP_FILE ]];then rm $ZIP_FILE fi -zip -x *.DS_Store -x *.md -x *sh -r $ZIP_FILE * > /tmp/lll +zip -x *.DS_Store -r $ZIP_FILE manifest.json background.js assets