Skip to content

Commit ad6595c

Browse files
authored
Merge pull request jae-jae#9 from JackieLiu1/master
fixed bug for the site contains port
2 parents 1fb54b9 + 535146e commit ad6595c

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

dist/show-site-all-userjs.gf.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var FetchUserjs = function () {
4646

4747
this.homeUrl = 'https://greasyfork.org/zh-CN/scripts/24508';
4848
this.api = 'https://greasyfork.org/en/scripts/by-site/{host}.json';
49-
this.host = location.host.split('.').splice(-2).join('.');
49+
this.host = location.hostname.split('.').splice(-2).join('.');
5050
this.showTime = 10;
5151
this.quietKey = 'jae_fetch_userjs_quiet';
5252
this.cacheKey = 'jae_fetch_userjs_cache';

dist/show-site-all-userjs.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var FetchUserjs = function () {
4646

4747
this.homeUrl = 'https://greasyfork.org/zh-CN/scripts/24508';
4848
this.api = 'https://greasyfork.org/en/scripts/by-site/{host}.json';
49-
this.host = location.host.split('.').splice(-2).join('.');
49+
this.host = location.hostname.split('.').splice(-2).join('.');
5050
this.showTime = 10;
5151
this.quietKey = 'jae_fetch_userjs_quiet';
5252
this.cacheKey = 'jae_fetch_userjs_cache';

userscript/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class FetchUserjs {
22
constructor() {
33
this.homeUrl = 'https://greasyfork.org/zh-CN/scripts/24508';
44
this.api = 'https://greasyfork.org/en/scripts/by-site/{host}.json';
5-
this.host = location.host.split('.').splice(-2).join('.');
5+
this.host = location.hostname.split('.').splice(-2).join('.');
66
this.showTime = 10;
77
this.quietKey = 'jae_fetch_userjs_quiet';
88
this.cacheKey = 'jae_fetch_userjs_cache';

0 commit comments

Comments
 (0)