()
| 601 | } |
| 602 | |
| 603 | function method2() { |
| 604 | let scriptJson = document.querySelectorAll( |
| 605 | 'script[type="application/json"]' |
| 606 | ); |
| 607 | for (let i = 0; i < scriptJson.length; i++) { |
| 608 | let match = scriptJson[i].text.match( |
| 609 | /"pk":"(\d+)","id":"[\d_]+"/ |
| 610 | ); |
| 611 | if (match) { |
| 612 | if (!window.location.href.includes("highlights")) { |
| 613 | return match[1]; |
| 614 | } |
| 615 | let matchs = Array.from( |
| 616 | scriptJson[i].text.matchAll( |
| 617 | /"pk":"(\d+)","id":"[\d_]+"/g |
| 618 | ), |
| 619 | (match) => match[1] |
| 620 | ); |
| 621 | const matchIndex = findHighlightsIndex(); |
| 622 | if (matchs.length > matchIndex) { |
| 623 | return matchs[matchIndex]; |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | return method1() || (await method3()) || method2(); |
| 630 | } |
no test coverage detected