Is it possible to update the manifest.json file from your app - json

I am new to coding and am using create-react-app to build my first app, and was wondering if it is possible to update the manifest.json file from within my app.
For example, if my folder structure is:
public
>index.hmtl
>manifest.json
src
>app.js
>index.js
would it be possible for me to write some code to update the contents of manifest.json? Or would that not work because it is not in the src folder?
The current contents of the manifest.json file are this:
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
But let's say I wanted to change the "icons" array to this:
"icons": [
{
"firstName": "Jon",
"lastName": "Smith",
"id": "1"
}
Is that possible?

Related

PWA getting installed in chrome broweser but not in firfox

PWA is getting installed from chrome broswer but not in firfox.
in firfox its showing start_url is outside the scope, so scope is invalid. what could be the issue?
please help!!
manifest.json file
{
"name": "App Installation issue",
"short_name": "App Installation issue",
"description": "App Installation issue",
"start_url": "d725eaf0-81db-40fe-8b0e-39fe53fa05bb",
"scope": "/app/d725eaf0-81db-40fe-8b0e-39fe53fa05bb",
"display": "standalone",
"background_color": "#ff00ea",
"theme_color": "#ca7f16",
"orientation": "any",
"related_applications": [
{
"platform": "webapp",
"url": "https://5450-202-43-120-104.ngrok.io/projects/vuexy-laravel-mpfg/public/d725eaf0-81db-40fe-8b0e-39fe53fa05bb/d725eaf0_81db_40fe_8b0e_39fe53fa05bb_manifest.json"
}
],
"icons": [
{
"src": "https://5450-202-43-120-104.ngrok.io/projects/vuexy-laravel-mpfg/public/storage/uploads/1/1660912953_architecture.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "any"
}
]
}

How to avoid chaining critical requests for webmanifest?

With Lighthouse, in the devtools, I'm getting an "Avoid chaining critical requests" warning about the site's webmanifest and its content:
Is there any way to avoid it?
I know you can prioritize the loading of resources with preload, but is there any option to de-prioritize loading for ressources from <link> elements? (<script> elements have defer/async, but what's to be done with link?) or anything that
This is what I'm using:
<link rel="manifest" href="https://assets.bilingueanglais.com/favicons/site.webmanifest?v=2022-03-15">
{
"name": "BilingueAnglais",
"short_name": "BilingueAnglais",
"icons": [
{
"src": "https://assets.bilingueanglais.com/favicons/android-chrome-192x192.png?v=2022-03-15",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "https://assets.bilingueanglais.com/favicons/android-chrome-512x512.png?v=2022-03-15",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

Invalid manifest message by launching

By launching my extension I get this message:
Invalid manifest
My manifest file is loaded. Here is it:
{
"name": "GoogleMapToContact",
"short_name": "GoogleMTC",
"description": "Save Google Geopoints to Google Contact",
"manifest_version": 2,
"version": "1.0.1",
"start_url": "/?homescreen=1",
"background_color": "#000000",
"theme_color": "#0f4a73",
"icons": {
"src": "map.png",
"sizes": "256x256",
"type": "image/png"
}
}
You have incorrect tags in your manifest.json. First 4 lines are OK.
Bad tags, that are not allowed in extensions manifest, are:
start_url (do you want to specify you entry point?)
background_color (it should be done in your popup file)
theme_color
Icons are written in slightly wrong way :) Here is suggested file
{
"name": "GoogleMapToContact",
"short_name": "GoogleMTC",
"description": "Save Google Geopoints to Google Contact",
"manifest_version": 2,
"version": "1.0.1",
"browser_action": {
"default_icon": "map.png",
"default_popup": "popup.html"
},
"icons": {
"16": "map16x16.png"
}
}

I get Invalid manifest: unknown fields: [api_console_project_id] when trying to publish app

I get his error when trying to save this manifest file:
Invalid manifest: unknown fields: [api_console_project_id]
My manifest file is
{
"timeZone": "America/New_York",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"api_console_project_id":"my-project-ID"
}
I've enabled and configured the google store SDK
Don't know if this helps buy my standalone manifests look something like this.
{
"update_url": "https://clients2.google.com/service/update2/crx",
"manifest_version": 2,
"name": "Exchange",
"description": "Link to...",
"version": "2.3",
"icons": {
"128": "128.png"
},
"container" : ["DOMAIN_INSTALLABLE"],
"api_console_project_id": "NOT_EASY_TO_FIND_PROJECT_ID",
"app": {
"urls": [
"https://script.google.com/a/macros/ilavietnam.edu.vn/s/PUBLISHED_ID/exec"
],
"launch": {
"web_url": "https://script.google.com/a/macros/ilavietnam.edu.vn/s/AKfycbx7Xj0EWjLyTDpzi44dFRw0zePAhvn-Qn4OpwaLpH5SjUNKaWA/exec"
}
},
"permissions": [
"unlimitedStorage",
"notifications"
]
}
Also the Market Place SDK API needs to be turned on.

which is the best way to save and display parent nodes with different child nodes(json)

My script makes an ajax request to a json as you can se below:
{"boxes": [{
"type": "cover",
"name": "Name",
"manu":"Manu",
"img": "img.jpg",
},{
"type": "type1",
"store":"Store",
"src": "Src",
"link":"link",
"de":"de",
"por": "por"
},{
"type": "article",
"site":"site",
"src": "src",
"link":"link",
"title": "title",
"txt": "txt"
},{
"type": "image",
"src": "src",
"link":"link"
},{
"type": "video",
"channel":"channel",
"name": "name",
"video":"video"
}]}
I would like to know which is the best way to save and display this data because if I save all content in a json file as it is now, the file gets huge and it is not good for performance.
I tried to save it in a BD (MySql) but as each parent node has diferent child nodes, I couldn't save it in the same table.
Someone has ideas to solve it?
Thank you!