Guest User

Untitled

a guest
Jan 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function returnRefinedURL(url) {
  2. return url.replace(new RegExp("=\\w+"),"").replace("?&","?")
  3. .replace("&&","&")
  4. }
  5.  
  6. testsAndRequests = []
  7.  
  8. document.querySelector('.report-waterfall').contentWindow.document.querySelectorAll('.vsc-initialized table .netTable').forEach((table, index) => {
  9. table.querySelectorAll('.netFullHrefLabel.netHrefLabel.netLabel ').forEach((row, rowIndex) => {
  10. if (rowIndex === 0) { testsAndRequests.push([]) }
  11. testsAndRequests[index].push(row.textContent);
  12. })
  13. })
  14.  
  15. firstTestRequests = testsAndRequests[0].map(returnRefinedURL);
  16. secondTestRequests = testsAndRequests[1].map(returnRefinedURL);
  17.  
  18. console.log('In A not in B: ', firstTestRequests.filter(x => !secondTestRequests.includes(x)));
  19. console.log('In B not in A: ', secondTestRequests.filter(x => !firstTestRequests.includes(x)))
Add Comment
Please, Sign In to add comment