- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 108
 
Description
System
- OS name: Debian
 - OS version: 12
 - Browser name: Firefox
 - Browser version: 130.0.1
 - Extension version: 6.1.1
 
Bug description
When trying to access the archive of the current tab when the website isn't loading, I receive the error notification stating "The page url is not valid". This mostly happens when trying to load a website that is experiencing an unexpected increase in traffic and is likely not returning a response.
Step 1. Try to access a website that is not loading.
Step 2. Click the extension icon in the tool bar. Make sure "Tab" is selected vs "URL"
Step 3. Click one of the engines, e.g. "Wayback Machine" or "Google".
Step 4. Receive error notification "The page url is not valid".
Debugging
I did some light debugging of the code to try to understand why this happens.
The relevant code appears to be in onActionPopupClick
web-archives/src/background/main.js
Line 762 in eb7bbdd
| async function onActionPopupClick(engine, docUrl) { | 
By logging the values of docUrl and tab.url in the function i get empty string for docUrl and "about:blank" for tab.url.
Meaning that OnActionClick will be passed "about:blank"
web-archives/src/background/main.js
Line 772 in eb7bbdd
| onActionClick(session, docUrl || tab.url); | 
Eventually searchDocument will be passed "about:blank"
web-archives/src/background/main.js
Line 466 in eb7bbdd
| async function searchDocument(session, doc, firstBatchItem = true) { | 
Where it will call validateUrl on the string. Since "about:blank" isn't a valid url with http https or ftp protocols used, it shows the
notification.
web-archives/src/background/main.js
Line 468 in eb7bbdd
| await showNotification({messageId: 'error_invalidPageUrl'}); | 
How to Fix
So basically I expected the string in the address bar to be passed to the extension, but rather the url of the previously loaded page appears to be passed.
To fix this I guess it could be changed so that the url in the address bar could be passed.
However that may break user's existing expectations in other contexts.
Should the code just stay as is and the user be expected to enter the url in the extension when the page isn't loading?
Any ideas on how to approach fixing this?