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

[BUG] alby:image meta tag gets overridden by favicon #1743

Closed
1 task done
jankoegel opened this issue Nov 10, 2022 · 1 comment
Closed
1 task done

[BUG] alby:image meta tag gets overridden by favicon #1743

jankoegel opened this issue Nov 10, 2022 · 1 comment
Labels
bug Something isn't working frontend All things frontend development related

Comments

@jankoegel
Copy link
Contributor

jankoegel commented Nov 10, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

  • on www.jan-koegel.de I have set <meta property="alby:image" content="https://ik.imagekit.io/jankoegel/img/photos/heidelberg-graffiti-underpass.jpg?tr=w-500,e-sharpen">
  • when I visit the page and open my Alby extension I see my favicon and not the image from the alby:image meta tag.

Favicon (actual)

alby:image (expected)

Screenshots [optional]

SCR-20221110-jur

Steps To Reproduce

  1. visit www.jan-koegel.de
  2. open the Alby extension
  3. see the favicon instead of the alby:image

Expected behavior

Screenshot 2022-11-10 at 14 20 59

Alby information

1.18.0
getAlby wallet
installed via app store

Device information

OSX, Firefox

Additional context

PR giving prevalence to metadata.icon (favicon) over metadata.image (alby:image)

  • style: prefer website icon over image #959
  • the metadata.icon rules actually start with alby:image:
    icon: {
    rules: [
    [
    'meta[property="alby:image"][content]',
    (element) => element.getAttribute("content"),
    ],

    but as far as I understand the code calling the rules, they get processed one after the other and later ones take precedence (unless the scorer function intervenes):
    for (let currRule = 0; currRule < ruleSet.rules.length; currRule++) {
    const [query, handler] = ruleSet.rules[currRule];
    const elements = Array.from(doc.querySelectorAll(query));
    if (elements.length) {
    for (const element of elements) {
    let score = ruleSet.rules.length - currRule;
    if (ruleSet.scorer) {
    const newScore = ruleSet.scorer(element, score);
    if (newScore) {
    score = newScore;
    }
    }
    if (score > maxScore) {
    maxScore = score;
    value = handler(element);
    }
    }
    }
    }

Are you working on this?

No

@escapedcat escapedcat added bug Something isn't working frontend All things frontend development related labels Nov 10, 2022
@bumi bumi closed this as completed Nov 14, 2022
@jankoegel
Copy link
Contributor Author

👍 working for me now.
Screenshot 2022-11-15 at 09 02 45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend All things frontend development related
Projects
None yet
Development

No branches or pull requests

3 participants