Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 20fc10c

Browse files
Fix GitHub pjax issues (#5)
Co-authored-by: Sindre Sorhus <[email protected]>
1 parent 1740ad3 commit 20fc10c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

background.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
chrome.webRequest.onBeforeRequest.addListener(function (details) {
44
if (details.method === 'GET') {
5+
const searchParams = new URLSearchParams(details.url.searchParams);
6+
searchParams.set('q', 'is:open');
7+
const newUrl = new URL(details.url + '?' + searchParams.toString());
8+
59
return {
6-
redirectUrl: details.url + '?q=is:open'
10+
redirectUrl: newUrl.href
711
};
812
}
913
}, {
1014
urls: [
11-
'https://github.com/*/*/issues'
15+
'https://github.com/*/*/issues',
16+
'https://github.com/*/*/issues?_pjax=%23js-repo-pjax-container',
1217
],
1318
types: [
14-
'main_frame'
19+
'main_frame',
20+
'xmlhttprequest'
1521
]
1622
}, [
1723
'blocking'

0 commit comments

Comments
 (0)