File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
background/sources/collections Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ const RECORDS_PAGE = 'https://haloruns.com/records?recent';
55const resolveLink = ( $link ) => {
66 return new URL ( $link . getAttribute ( 'href' ) , RECORDS_PAGE ) . href ;
77} ;
8+ const embedLink = ( $link ) => {
9+ const $a = document . createElement ( 'a' ) ;
10+ $a . href = resolveLink ( $link ) ;
11+ $a . target = '_blank' ;
12+ $a . textContent = $link . textContent ;
13+ return $a . outerHTML ;
14+ } ;
815
916export default async ( ) => {
1017 const body = await util . ajax ( RECORDS_PAGE ) ;
@@ -56,8 +63,8 @@ export default async () => {
5663 title : game + ' ' + difficulty + ' - ' + $level . textContent +
5764 ' (' + $newRecord . textContent . replace ( / / g, '' ) + ')' ,
5865 timestamp : date . getTime ( ) ,
59- desc : 'Previous Record: ' + $previousRecord . outerHTML +
60- ' by ' + $previousUser . outerHTML + '<br />' +
66+ desc : 'Previous Record: ' + embedLink ( $previousRecord ) +
67+ ' by ' + embedLink ( $previousUser ) + '<br />' +
6168 'Time Saved: ' + timeSaved ,
6269 game : { name : game } ,
6370 } ) ;
You can’t perform that action at this time.
0 commit comments