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

Problem adding manifest link in header #75

Open
femiveys opened this issue Jun 8, 2015 · 8 comments
Open

Problem adding manifest link in header #75

femiveys opened this issue Jun 8, 2015 · 8 comments

Comments

@femiveys
Copy link

femiveys commented Jun 8, 2015

This is probably because of some module used, but hopefully someone can help me out.
I am making a web app and I need to link in a manifest file.

On a vanilla meteor I can do:

<head>
  <title>test</title>
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="manifest" href="/manifest.json">
</head>

When I do the same however on a fresh meteor-starter, for some reason the meta name="mobile-web-app-capable" and the link rel="manifest" are removed from the <head> section.
When I add a link rel="icon" however, it is not removed, which is the expected behavior.

So what makes those head tags disappear? Should I set somewhere what head tags are whitelisted?

Right now I use this workaround, but it is ugly:

Template.masterLayout.onRendered(function() {
  $('head').append('<link rel="manifest" href="/manifest.json">');
  $('head').append('<meta name="mobile-web-app-capable" content="yes">');
});
@mpowaga
Copy link
Collaborator

mpowaga commented Jun 10, 2015

Are you doing this in client/index.html file? If not try edit <head> tag in that file.

@femiveys
Copy link
Author

Yes, I do it in client/index.html.
Just try it on a fresh install. You'll see these tags are ignores.

@mpowaga
Copy link
Collaborator

mpowaga commented Jun 10, 2015

Tags are in the markup returned from the server (you can see it with "View Page Source" on chrome) but disappear when inspected with chrome dev tools. Strange but it looks for meteor or chrome dev tools issue.

@femiveys
Copy link
Author

You're right.
I just checked and I can confirm this.
This is really strange. In Firefox I see exactly the same behavior. So probably it's not the dev tools.
Another strange thing is that I see the <title>tag twice in de header. Maybe it's related.

@sahilyousif
Copy link

I'm getting a strange behavior too on using:

<link rel="manifest" href="/manifest.json">

In the console, it reads:
"Manifest parsing error: Line: 1, column: 1, Unexpected token."
So i tried removing the manifest file and it threw the same error regardless of the file being present or not.

Then I open up /manifest.json from the dev tools, and it seems meteor is responding to /manifest.json with the application template itself.

So far I have no idea why I'm not able to load the manifest.json, I just started learning meteor last week. Am i missing out something?

@JProgrammer
Copy link

The package manuelschoebel:ms-seo is messing with this. I found in my own project it is removing the link from the header before the browser gets it.

@kyooriouskoala
Copy link

I'm not using this package but just had similar, if not the same, issue where link rel='manifest' gets removed. As JProgrammer had mentioned, the issue was caused by manuelschoebel:ms-seo package. To fix the issue, you can try to use this option: https://github.com/DerMambo/ms-seo#using-ignore

@iamtreymakzw
Copy link

iamtreymakzw commented Jul 16, 2023

The solution here is to add the manifest details to the default config for the package.

  // set default config for SEO package
    return SEO.config({
        title: "",
        meta: {
            title: "",
            description:
                "",
            site_name: "",
            viewport: "",
        },
        og: {
            title: "",
            site_name: "",
        },
      link: [
        {
          home: "",
        },
        {
          rel: "manifest", href: "/manifest.webmanifest"  
        },
      ]
    });

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

6 participants