When using PWA Shortcuts, is it possible to localize the shortcut name? - progressive-web-apps

Our PWA is used globally and is localized for users.
If we use PWA shortcuts, is it possible to localize the shortcut names in the manifest.json file?
https://web.dev/app-shortcuts/
For example, if we had a shortcut called "Search", I would want that to appear in Japanese "検索" for a user with a Japanese language set in their operating system.

There's no way to specify different language strings in the manifest today, the only way to do it would be to serve a different manifest depending on the language of the users browser.
There are two options for doing that:
Have the server return a different manifest file depending on the Accept-Language HTTP header sent by the users browser.
Add (or update) the manifest link in the page after checking the users preferred language.
Personally, I'd recommend the first option. The manifest file name would remain the same for all users, and it would require no client side code and wouldn't affect page performance in any way.
The second would require JavaScript to update the manifest link, and while not expensive, the less client side code you run, the better. It also means each language would have it's own manifest file, so if I change my browser language, I may be prompted to install the PWA again because it's now a new manifest.

Related

Can we translate the Page URLs using Language Copy in AEM?

We are planning to use the Language copy feature for the translation of our English content and have done a small POC using Microsoft trial translator.
We noticed that the created language copy has the URL structure in the English language itself. Let's say if we create a language copy of /content/site/en/test-page, it will create it as /content/site/es/test-page, which is correct but the URL of the Spanish page would be in English. But we want to translate the URL as well for the Spanish language copy. So it should be /content/site/en/página de prueba (in Spanish)
Is it achievable to translate the URL of the page using language copy? what are the different options here?
AEM needs pages to have the same path (and name) after the language node in order to see that this is / should be a language copy. So changing the node name is not an option in your case. In addition to that, changing a page name will be regarded as a move event in AEM and in the end, AEM will not be able to connect your language copies any more.
You can change the alias instead, which is in the page properties in the "Advanced" tab (see https://docs.adobe.com/content/help/en/experience-manager-65/authoring/authoring/editing-page-properties.html for further explanations). If you have spanish aliases for all spanish pages, then your URLs will be using those spanish aliases which is exactly what you would like to have, I guess...
HTH,
OliG

is it possible to add a hyperlink to sharepoint document which will be opened from browser in unity

Is it possible to add a hyperlink to Sharepoint document which should be opened from browser in Unity?
So that i can scroll my pdf documents by wearing HoloLens or Realwear devices.
You can use Unity's Application.OpenURL.
Opens the URL specified, subject to the permissions and limitations of your app’s current platform and environment. This is handled in different ways depending on the nature of the URL, and with different security restrictions, depending on the runtime platform.
Note: This method can be used to open more than just web pages, so it has important security implications you must be aware of.

With Chrome Apps soon to be removed, is there another way to edit a local file?

The Chrome Apps API has the very useful FileSystem API which allows a user to select a file for an app to edit (read and write changes to). However, with the entire Apps API soon to be removed, what other ways exists to edit a file on the local file system?
This is not an opinion-based question, I am asking for all conceivable alternatives.
Per https://developers.chrome.com/apps/migration:
Q: My app uses the chrome.fileSystem API to read and write user-specified files and / or directories. Can this be done on the open web?
A: In general, no. The open web can read single files that the user opens, but cannot retain access to those files, write to those files, or have any access to directories.
If it is critical for your app to read and write directories (e.g. it is a text editor with a folder view), you will need to either have a native helper app and extension combo, or create a native app.

Is it possible for an app to be decompiled?

I need to code in authentication information for specific parts of my website into my app. Is it at all possible for the app to be "decompiled" and the username and password exposed?
NSURL *url = [NSURL URLWithString:#"https://predefinedUsername:predefinedPassword#www.website.com"];
Yes, it is possible. Assume that if you have anything compiled into your app, it can [and will] be discovered by someone somewhere. Even if it isn't possible today, you are creating a frozen record of such information that will be vulnerable to any future attacks, known or unknown.
You really need the user to perform some task that authenticates them. There are a million and one ways to do that, and for every one of those, a million and two ways to do it wrong. :)
Without knowing more about your specific requirements, it is impossible to really say much more outside of "keep it simple and don't store or send anything in clear-text".
As #Hyperbole said, If you store the username and password in plain text it will be visible in the executable. It is extremely trivial to examine the executable for strings, and it's usually the first thing someone with malicious intent will try.
Right click on any app you've downloaded in iTunes and select show in finder. Make a copy of the app on your desktop and rename the app from AppName.ipa to AppName.zip. Double-click to unzip it, and look inside the folder. Navigate to the folder Payload and then right click on the (probably only) file in there called AppName that looks like an application but has a big circle with a cross through it for the icon. Select show package contents. Scroll through until you find a file called AppName with no extension and a blackish rectangle with the green word "exec" as an icon. Open that file in text edit or another text editor. You'll find that most of this ends up being random symbols and other crap, but you should occasionally see some plain text. The compiler takes string constants and embeds them directly in the app when you compile it in most cases.
You asked about what magazine apps and others do to access content - There are a ton of different ways to do it but off the top of my head, after the server verifies your in-app purchase receipt, the server would record an identifier specific to your iTunes account, saying that you've purchased a specific issue of the magazine. Then your app can request that file from the server, adding the identifier to the request in the process. The server would respond with the file once it looks through the database and determines that you've purchased the content.
Other solutions include signing/hashing a unique key.
Your example would expose the username and password without the need to decompile as you send it via plain text in a URL request. Anyone with a sniffer or MITM service yould snatch it out of the air. A better approach would be to make use of SSL via the http*s* protocol. You could go a step further and either prompt at runtime for the credentials and/or store an encrypted version within the app.
This is very bad because it is trivially easy to recover these credentials just by running 'strings' against the app binary without needing to decompile it.
Can't you pop up a dialogue box asking the user to enter the credentials when they first start the app ? Alternatively you could store them encrypted in a file and then ask the user for an alternative credential e.g. Passcode that derives the key but even this will not survive a determined attack unless the Passcode is long.

tinymce file browsers multiple file source

I am doing some updates to a site I have developed over the last few years. It has grown rather erratically (I tried to plan ahead, but with this site it has taken some odd turns).
Anyway, the site has a community blog ( blog.domain.com - used to be domainblog.com) ) and users with personal areas ( user1.domain.com, user2.domain.com, etc ).
The personal areas have standard page content that the user can use, or add snippets of text to partially customize. Now the owner wants the users to be able to create their own content.
Everything is done up to using a file browser.
I need a browser that will allow me to do the following:
the browser needs to be able to browse the common files at blog.domain.com/files and the user files at user_x.domain.com/files
the browser will also need to be able to differentiate between the two and generate the appropriate image url.
of course, the browser access to the user files will need to be dynamic and only show those files particular to the user (along with the common files)
I also need to be able to set a file size for images
the admin area is in a different directory than either the blog or the user subdomains.
general directory structure
--webdir--
|--client --
|--clientsite--
|--blog (blog.domain.com)
|--sites--
|--main site (domain.com)
|--admin (admin.domain.com)
|--users--
|--user1 (user1.domain.com)
|--user2 (user2.domain.com)
...etc.
I have tried several different browsers and using symlinks but the browsers don't seem to be able to follow them. I am also having trouble even setting them to use a directory that isn't the default.
what browser would you recommend? what would I need to customize to make it work.
TIA
ok, since I have not had any responses to this question, I guess I will have to do a work around and then see about writing a custom file browser down the road.