Skip to content

Commit

Permalink
Merge pull request #40 from foooomio/release
Browse files Browse the repository at this point in the history
Release v3.0.2
  • Loading branch information
foooomio authored May 28, 2024
2 parents dd07f2c + 0232406 commit 92b89c3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "__MSG_extName__",
"version": "3.0.1",
"version": "3.0.2",
"description": "__MSG_extDescription__",
"default_locale": "en",
"permissions": ["contextMenus"],
Expand Down
5 changes: 5 additions & 0 deletions src/viewer/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ export function showError(error) {
$('error-details').textContent = error.toString();
$('error').classList.remove('hidden');
$('nav').classList.add('hidden');

const [firefox, version] = navigator.userAgent.match(/Firefox\/(\d+)/) ?? [];
if (firefox != null && Number(version) < 127) {
$('error-firefox').classList.remove('hidden');
}
}
12 changes: 10 additions & 2 deletions src/viewer/gallery.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import { $, $e } from './utils.js';

/**
* @param {string} url
* @returns {string}
*/
function getCaption(url) {
const [, mediaType] = url.match(/data:(.+?)[,;]/) ?? [];
return mediaType ?? url;
}

/**
* @param {string[]} images
*/
export function setupGallery(images) {
const figures = images.map((image) => {
const caption = image.startsWith('data:image/svg+xml') ? 'SVG' : image;
return $e(
'figure',
{},
$e('a', { href: image }, $e('img', { src: image })),
$e('figcaption', {}, caption),
$e('figcaption', {}, getCaption(image)),
);
});

Expand Down
10 changes: 10 additions & 0 deletions src/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ <h1 id="error-message"></h1>
<ul>
<li id="error-reload"></li>
<li id="error-security"></li>
<li id="error-firefox" class="hidden">
Open about:addons and enable Permissions &gt; Access your data for all
websites. <br />
<a
href="https://discourse.mozilla.org/t/content-scripts-do-not-load/130009"
target="_blank"
>
Please see this issue for more details.
</a>
</li>
</ul>
<p id="error-details"></p>
<p>
Expand Down

0 comments on commit 92b89c3

Please sign in to comment.