ArchiveBox / archivebox-browser-extension

Official ArchiveBox browser extension: automatically/manually preserve your browsing history using ArchiveBox.
https://chromewebstore.google.com/detail/archivebox-exporter/habonpimjphpdnmcfkaockjnffodikoj
MIT License
244 stars 21 forks source link

Suggestion: Add "Archive Current Page" #26

Open ludos1978 opened 4 months ago

ludos1978 commented 4 months ago

From my usage experience (a week), i mostly want to archive a page i currently have open. Up till now i never used the url-regex system.

So my suggestion is to add the buttons to archive the current page, to the default window.

tjhorner commented 4 months ago

There is a context menu item available for this. Right click anywhere on the page and you should see "ArchiveBox Exporter" > "Archive Current Page" in the list.

huyz commented 3 months ago

One can also right-click on the menubar icon.

I do wish there were a button on the pop-up window for Archive current page. Also a keyboard shortcut would be nice

pirate commented 3 months ago

Both are good ideas, I think both are fairly easy to add with a couple handler funcs and one-line changes to manifest.json. If anyone wants to contribute this I think it can be done by copy pasting in the source code and asking ChatGPT what changes to make. PRs welcome :)

huyz commented 3 months ago

Oh I could try this for keyboard shortcut: https://github.com/ArchiveBox/ArchiveBox/discussions/1248

pirate commented 3 months ago

I wouldn't do it that way, there is a keyboard shortcuts API built into extensions already, it's very simple and just requires one line in manifest.json defining the default key combo + a handler function to call when it's pressed.

The benefit of using the native API is chrome provides the UI to change the default key combo to something else.

huyz commented 3 months ago

I wrote:

One can also right-click on the menubar icon.

Actually, that method doesn't work for some reason. No matter, most people won't know about this "Archive Current Page" path anyway.

@ pirate wrote:

I wouldn't do it that way, there is a keyboard shortcuts API built into extensions already

Yeah for sure. I just meant for myself until it's supported in the extension. If I have some time I'll try to do a PR for the extension.

ludos1978 commented 3 months ago

I must have been very unclear in my description. I do think it would be way better to have the "archive current page" on the left click, instead of having it on the right click.

Currently a left click leads to a window that gives advances settings and options but not the most important basic functions.

My suggestion was to add a Button "Archive current page" to the window that opens on the left click.

huyz commented 3 months ago

@ludos1978 You were very clear. It's me who confused you with my right-click suggestion (which I later retracted). We're all on the same page: we want to be able to quickly add the current page with a left-click on the icon.

ludos1978 commented 3 months ago

A good inspiration might be the wayback-machine browser plugin.

Not sure which features are required, but a big button on top would be a great solution :-)

Bildschirmfoto 2024-08-06 um 16 35 27
Steering7253 commented 2 weeks ago

Actually, that method doesn't work for some reason. No matter, most people won't know about this "Archive Current Page" path anyway.

Because the pageUrl is not available to toolbar context menu entries. This entry should not be displayed on 'all' context menus. (IMO it shouldn't be displayed in any context menus, I don't really want even more context menu entries overflowing the screen when I right click on a page, although that's Chrome's fault)

https://stackoverflow.com/a/14251218/2283305

(Also the context menu, even right clicking on the page, also doesn't work in some cases like when you're looking at a PDF in Chrome's built-in viewer)

Steering7253 commented 2 weeks ago

Something like https://github.com/Steering7253/archivebox-browser-extension/commit/793c0a225cbe0c7ab16f9ad6a575ba5627cc7a05

(BTW package.json is malformed)