File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
background/sources/collections Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 11import * as util from '../../util.js' ;
22
33
4+ const RECORDS_PAGE = 'https://haloruns.com/records?recent' ;
5+ const resolveLink = ( $link ) => {
6+ return new URL ( $link . getAttribute ( 'href' ) , RECORDS_PAGE ) . href ;
7+ } ;
8+
49export default async ( ) => {
5- const body = await util . ajax ( 'https://haloruns.com/records?recent' ) ;
10+ const body = await util . ajax ( RECORDS_PAGE ) ;
611 let $items = body . getElementById ( 'recentWRTable' ) ;
712 if ( ! $items ) {
813 throw Error ( 'Error retrieving videos' ) ;
@@ -37,16 +42,15 @@ export default async () => {
3742 let $newUser = $col4 . children [ 1 ] . children [ 0 ] ;
3843 let timeSaved = $col5 . textContent . replace ( ' : ' , ':' ) ;
3944
40- let url = $newRecord . href ;
4145 items . push ( {
4246 col : {
43- url : $level . href ,
47+ url : resolveLink ( $level ) ,
4448 users : [ {
45- url : $newUser . href ,
49+ url : resolveLink ( $newUser ) ,
4650 name : $newUser . textContent ,
4751 } ] ,
4852 } ,
49- url : url ,
53+ url : resolveLink ( $newRecord ) ,
5054 thumbnail : null ,
5155 length : util . timeToSeconds ( $newRecord . textContent ) ,
5256 title : game + ' ' + difficulty + ' - ' + $level . textContent +
You can’t perform that action at this time.
0 commit comments