Manifest., I want to modify the start_url of the json file after the page is loaded. This is because our app's start_url is different for each user. Because the parameters are different for each user, we need to load start_url dynamically I do not know how to fix it dynamically.
Is there any way to do this? Could it be possible when ServiceWorker is installed?
Editing a manifestOpen the script project in the Apps Script editor. At the left, click Project Settings settings. Select the Show "appsscript. json" manifest file in editor checkbox.
The start_url member is a string that represents the start URL of the web application — the preferred URL that should be loaded when the user launches the web application (e.g., when the user taps on the web application's icon from a device's application menu or homescreen).
Using manifest. json , you specify basic metadata about your extension such as the name and version, and can also specify aspects of your extension's functionality (such as background scripts, content scripts, and browser actions).
json is a simple JSON file in your website that tells the browser about your website on user's mobile device or desktop. Having a manifest is required by Chrome to show the Add to Home Screen prompt.
I solved a similar problem by using a url for a php file instead of a json file.
<link rel="manifest" href="/manifest.php?start_url=val">
The php file returns a json and when generating the page my server populates the url parameters dynamically. Everything working perfectly...
Suppose you have 3 categories. Make three .json files with respective scopes. Let's say japanese.json, black.json, voyeur.json
$currentpage =$_SERVER['REQUEST_URI'];
if ($currentpage == "/japanese") {
$this->output('<link rel="manifest" href="/japanese.json">');}
if ($currentpage == "/black") {
$this->output('<link rel="manifest" href="/black.json">');}
if ($currentpage == "/voyeur") {
$this->output('<link rel="manifest" href="/voyeur.json">');}
You can also modify if you have a bunch of categories or the url structures are more complex.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With