Skip to content

Commit

Permalink
Fix bug cached viewLesson page
Browse files Browse the repository at this point in the history
  • Loading branch information
ComMouse committed Sep 14, 2016
1 parent e9760c9 commit 8626af1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content_script/lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ function optimize_elect()
var me = this;

// 有缓存的情况下直接加载缓存页面
console.log(g_arrange_cache, lid);
//console.log(g_arrange_cache, lid);
if (g_arrange_cache.hasOwnProperty(lid)) {
var cache = g_arrange_cache[lid];
var now = new Date().getTime();
console.log(cache.expire > now);
//console.log(cache.expire > now);
if (cache.expire > now) {
// 更改 pushstate
window.history.replaceState({lid: lid}, 'speltyGeneralCourse', url);
Expand All @@ -165,7 +165,7 @@ function optimize_elect()
// 处理新页面
var body = cache.html
.replace(/\.\.\//g, '../../')
.replace(/(\w+).aspx/g, '../../lesson/$1.aspx');
.replace(/(viewLessonArrange).aspx/g, '../../lesson/$1.aspx');
var bodyStart = body.indexOf('<form name="viewLesson"');
var bodyEnd = body.lastIndexOf('</form>');
body = body.substring(bodyStart, bodyEnd + '</form>'.length);
Expand Down

0 comments on commit 8626af1

Please sign in to comment.