200 Commits

Author SHA1 Message Date
Olivier Meunier 18a1427705 Version 2.6.3 2.6.3 2026-04-03 17:50:12 +02:00
Olivier Meunier 3eb692a39a Exclude screenshots from the source zip file 2026-04-03 17:50:01 +02:00
olivier df4352b546 Merge pull request 'Fix typo for "Mark as read" button' (#124) from superuser-does/browser-extension:fix-typo into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/124
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-04-03 12:19:02 +02:00
superuser-does 529c6b79fb Fix typo 2026-04-03 12:16:59 +02:00
Olivier Meunier d59e6a3e8b Prevent bookmark from being patched after saving.
The reactive statement that triggers a bookmark update included
"bookmarkId", meaning that an update would be triggered after saving
(bookmarkId goes from empty to a value), regardless of the (unchanged)
state of the other attributes.

This moves the test on bookmarkId in a sub function so its value doesn't
trigger the reactive statement.

Resolves #121
2026-04-03 12:11:08 +02:00
Olivier Meunier 4f58c899c7 Accept image order in fetchResource
This adds an "Accept" header in fetchResource with some priorities when
it comes to images. JPEG and PNG is favored over formats like webp
(avoiding a conversion to JPEG or PNG again).
This avoid prioritizing AVIF that Readeck can't decode.

Resolves #122
2026-04-03 10:47:47 +02:00
olivier 2face522d2 Merge pull request 'Ignore JS exceptions when attempting to serialize canvas to image' (#115) from canvas-exception-handler into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/115
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-04-03 10:27:33 +02:00
Mislav Marohnić 1dcb377b13 Ignore JS exceptions when attempting to serialize canvas to image
This avoids the bookmark save process getting aborted when even a single canvas
element on the page is "tainted", i.e. it embeds cross-site content and
browsers thus prohibit to capture its data as an image.
2026-04-03 10:27:33 +02:00
Olivier Meunier 71515f81cd Always minify JS files and add NODE_ENV production on release targets 2026-04-03 10:23:54 +02:00
olivier 8bd76ee319 Merge pull request 'Enable source maps' (#117) from enable-sourcemaps into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/117
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-04-03 10:21:54 +02:00
Mislav Marohnić 5bbb859aad Enable source maps
For easier debugging in both development and production, this configuration
change unconditionally enables source maps so that using devtools in a browser
would print the original source locations in stack traces.
2026-04-03 10:21:54 +02:00
Olivier Meunier afce342df0 Enable linting on src/ and root js files 2026-04-03 10:07:16 +02:00
olivier 1a5324fdf4 Merge pull request 'Stricter JS linting with eslint' (#116) from eslint-more into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/116
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-04-03 10:04:56 +02:00
Mislav Marohnić f6696c1c3d Stricter JS linting with eslint
- Enable the "recommended" set of eslint rules across the whole project
- Fix violations due to "no-unused-vars"
- Declare in eslint configuration which source files we expect to be CommonJS and which are ESM
- Remove "async" from functions that shouldn't have it
2026-04-03 10:04:56 +02:00
Olivier Meunier 55cea7d09e Linting fixes and layout minor improvements.
- centered messages
- min-height on the popup window
- margin adjustments
2026-04-03 09:50:16 +02:00
olivier b0a2eb2191 Merge pull request 'Move progress indicator below input fields' (#118) from sockenklaus/browser-extension:progress-indicator-in-form into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/118
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-04-03 09:40:48 +02:00
Sockenklaus 3e539cb4ee Moved "Bookmark saved" message back to the top of the dialog, added slide transition and set disabled a little bit stricter. 2026-03-16 00:53:44 +01:00
Sockenklaus a14d42d35b Removed vertical center alignment and moved "Bookmark saved" notification below input fields to smoothen UX in save.svelte. 2026-03-15 09:06:34 +01:00
Sockenklaus 24c1e72476 restructured save.svelte to show progress indicator in save form. 2026-03-15 02:09:10 +01:00
Olivier Meunier a2f2d12fb6 Version 2.6.2 2.6.2 2026-03-04 00:07:07 +01:00
Olivier Meunier 86d6df3485 Improved "icon-[" CSS selector 2026-03-03 23:10:06 +01:00
Olivier Meunier 2146edfcd0 Fix Shadow DOM cloning, improve finding original images
The new Shadow DOM cloning approach avoids issues with browser warning about
adopted stylesheets. However, now that we do shadow DOM cloning, mapping cloned
image elements to their original elements (so that they can be measured) is a
bit more non-trivial. The updated approach builds a map of all image elements
and tags them with a temporary HTML attribute so that mapping post-cloning can
be performed un-ambiguously.

Closes #111
Followup to #110, 9516287866

Original author: @mislav

Apologies for accidentally removed the remote branch from #112...
2026-03-03 23:04:44 +01:00
Olivier Meunier 9516287866 Avoid setting element's innerHTML
This triggers a security warning from the linter and when submitting
a new version.
2026-03-03 13:53:13 +01:00
Olivier Meunier 52be3acb60 Version 2.6.1 2.6.1 2026-03-03 12:54:41 +01:00
Olivier Meunier 67181bd83a Use page keywords as labels after saving
Nothing prevents a user from using the page keywords as labels after a
bookmark is saved.

Better "keywords" icon
2026-03-03 12:13:12 +01:00
Olivier Meunier 2bed54eee8 Added a button to clear labels
Before and after saving, this button clears the label list.
Resolves #91
2026-03-03 11:56:00 +01:00
Olivier Meunier 86233b1470 Updated changelog 2026-03-03 11:31:21 +01:00
Olivier Meunier 5f7f9369af Merge branch 'feature/post-edit' 2026-03-03 11:30:26 +01:00
Olivier Meunier 7e236a268e Mark bookmark as read after saving
This adds a button so a bookmark can be marked as read after saving it.
Resolves #77
2026-03-03 11:28:24 +01:00
Olivier Meunier 0ad1908ef6 Title and labels edit after saving
This adds the title and label input after saving a bookmark so a user
can change them easily when saving is done.
2026-03-03 11:23:47 +01:00
Olivier Meunier 5e72167d2c Migrated to iconify
Removes boxicons and its react dependency and simplifies adding icons
to the extension.
2026-03-03 11:12:59 +01:00
Olivier Meunier 3dbb130a84 Avoid overflow of long hostnames in the popup
Resolves #105
2026-03-03 09:51:52 +01:00
Olivier Meunier 36a042668f Updated dependencies 2026-03-03 09:33:28 +01:00
olivier 74ea78dc3f Merge pull request 'Serialize contents of shadow DOM host elements' (#110) from shadow-dom into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/110
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-03-03 09:22:55 +01:00
Mislav Marohnić ff3d290998 Serialize contents of shadow DOM host elements
When an element hosts a Shadow DOM, its contents will appear empty using
traditional DOM traversal:

    const myEl = document.querySelector("my-custom-element")
    myEl.firstChild //=> null
    myEl.shadowRoot //=> ShadowRoot

and if that host ever gets cloned, it will be completely empty and not even
host to any Shadow DOM anymore:

    const clonedEl = myEl.cloneNode(true)
    clonedEl.firstChild //=> null
    clonedEl.shadowRoot //=> null

The Readeck browser extension captures page content by cloning the original
document and serializing it using `outerHTML`:

    page.content = clonedDoc.documentElement.outerHTML

but because of how Shadow DOM behaves, this serialization method will never be
able to capture the contents of elements that are hosts to a Shadow DOM.

This change makes sure that all elements that are Shadow DOM hosts are
explicitly serialized using `el.getHTML()`.

Ref. https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM
2026-03-03 09:22:32 +01:00
olivier c4d29f44a8 Merge pull request 'Add support for object SVGs and canvas elements' (#109) from image-types into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/109
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-03-03 09:18:26 +01:00
Mislav Marohnić c56d1b7fc7 Add support for image embeds via object tags and canvas elements
Adds support for:

    <object type="image/*" data="{href}">Alt text here</object>

by adding href to prefetch URLs.

Also adds support for:

    <canvas></canvas>

by rasterizing the canvas element to an image with a "data:" URL.
2026-03-03 09:18:26 +01:00
Olivier Meunier d9ae84a03f Merge branch 'main' of codeberg.org:readeck/browser-extension 2026-03-03 09:15:48 +01:00
olivier 632143aba7 Merge pull request 'doc: safari needs to allow unsigned extension' (#107) from landsman/browser-extension:safari-docs into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/107
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-03-03 09:12:49 +01:00
Michal Landsman 451f587d22 doc: safari needs to allow unsigned extension 2026-02-09 20:53:11 +01:00
Olivier Meunier b1510c9c9d Version 2.6.0 2.6.0 2026-02-06 12:50:56 +01:00
Olivier Meunier 69542c762c Updated dependencies 2026-02-06 12:47:02 +01:00
Olivier Meunier 6dd02b4152 Updated changelog 2026-02-05 16:38:33 +01:00
olivier 13a0f5bf00 Merge pull request 'Add Safari support' (#101) from Nicell/browser-extension:safari-support into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/101
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-02-05 16:36:54 +01:00
Nick Winans ed877784ad Add Safari support 2026-02-05 16:36:54 +01:00
olivier 225ceec9cd Merge pull request 'Store image display dimensions to HTML attributes' (#94) from image-dimensions into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/94
Reviewed-by: olivier <olivier@noreply.codeberg.org>
2026-02-05 16:15:05 +01:00
Mislav Marohnić 8652aee412 Store image display dimensions to HTML attributes
When sending page HTML to Readeck, this populates "data-readeck-width" and
"data-readeck-height" attributes with display dimensions for each image.

This will help the Readeck backend decide how to process images based on their
display dimensions which take CSS into account, rather than by their physical
dimensions. This is especially useful for SVG icons which the Readeck backend
wants to strip away, but whose `viewport` and width/height dimensions as
indicated by their markup often does not reflect their final display dimensions.
2026-02-05 14:07:51 +01:00
olivier 68a1a32029 Merge pull request 'Simplified authorization flow' (#104) from feature/easy-oauth into main
Reviewed-on: https://codeberg.org/readeck/browser-extension/pulls/104
2026-02-05 06:38:11 +01:00
Olivier Meunier 11f411c8fa Simplified authorization flow
The current flow is quite complex and relies on listeners that can be
conflicting with other extensions.

This is a much simpler approach:

- the OAuth redirection is a real, web accessible, resource
- the redirection page sends a message to the extension with its
  query parameters
- the oauthPrompt function listens to the message and resolves with
  the authorization result

And that's it!

This adds the oauth-callback.html page to "web_accessible_resources"
for any http or https URL.

Incidentally, this resolves #93
2026-02-04 15:51:02 +01:00
Olivier Meunier 8f7e416bbc Updated changelog 2026-02-04 15:40:21 +01:00