In chrome extension, how to get the original URL and terminal URL in a navigation event?

  1. I’ve tried using the chrome.webNavigation.onCompleted API, but it doesn’t work because it can only get the terminal URL
  2. chrome.webNavigation.onBeforeNavigate can get pendingUrl, which is the original URL, but when a new tab is created in the navigation, pendingUrl becomes “”.

Is there any practical API that works in this specific scenario? Or are there any solutions to solve this problem? I will appreciate it!!