Skip to content

Commit 7ef2d8d

Browse files
committed
CRSearch: base_url初期化オプションに対応
1 parent ea24591 commit 7ef2d8d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

js/crsearch/crsearch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default class CRSearch {
2525
},
2626
google_url: new URL('https://www.google.co.jp/search'),
2727
force_new_window: false,
28+
base_url: null,
2829
}
2930

3031
static _KLASS = 'crsearch'
@@ -118,6 +119,8 @@ export default class CRSearch {
118119

119120
_parse(url, json) {
120121
this._log.info('parsing...', json)
122+
if (this._opts.base_url)
123+
json.base_url = this._opts.base_url
121124

122125
const db = new Database(this._log, json)
123126
this._db.set(db.name, db)

js/crsearch/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default class Index {
100100
}
101101

102102
url() {
103-
return new URL(`/${this.fullpath}.html`, this._ns.base_url)
103+
return new URL(`${this.fullpath}.html`, this._ns.base_url)
104104
}
105105

106106
get ns() {

0 commit comments

Comments
 (0)