Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive "The page url is not valid" error notification when trying to access archive of website tab that is not loading. #102

Open
kbailey4444 opened this issue Sep 19, 2024 · 0 comments

Comments

@kbailey4444
Copy link

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

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"

onActionClick(session, docUrl || tab.url);

Eventually searchDocument will be passed "about:blank"

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.
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant