GoogleChromeLabs / GoogleChromeLabs/bubblewrap
Shortcuts not working
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 319
- PR merge metrics
- No merged PRs in 30d
Description
# Bug
I apologize if this is in Korean, but as you can see, pressing on the shortcut button doesn't do anything.
It opens the app than closes it right away.
The same url/icons work on PWA installed apps shortcuts, though.
[untitled.webm](https://user-images.githubusercontent.com/78584173/227701247-6e3fa844-60fc-48c9-a93f-307905aecb95.webm)
# Device
My Device:
```
One UI Version: 4.1
Android Version: 12
Bubblewrap: 1.19.1
```
Emulator on video below:
```
API Level: 33
Name: Resizable (Experimental) API 33
```
# Code - Manifest JSON File
```json
"shortcuts": [
{
"name": "중간고사 있는 과목",
"shortName": "중간 있는 과목",
"url": "/?dark=false&lang=ko-KR?midterm=true",
"chosenIconUrl": "https://finalscalcu.web.app/images/48x48.png"
},
{
"name": "중간고사 없는 과목",
"shortName": "중간 없는 과목",
"url": "/?dark=false&lang=ko-KR?midterm=false",
"chosenIconUrl": "https://finalscalcu.web.app/images/48x48.png"
}
],
```
# Reproducing
1. On bare minimum, put in the shortcuts details
2. Or if maintainers do need a repo, I have a repo here: https://github.com/hslee2008/FinalsCalculator (Install everything and run `yarn build:android`, all the files related is in `android` folder)
# Not sure if Related
Currently, using `short_name` as the key doesn't work.
Is using `shortName` correct?
```
>> [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\util.js:299
return input.replace(/[\\']/g, '\\\\\\$&');
^
TypeError: Cannot read properties of undefined (reading 'replace')
at Object.escapeGradleString (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\util.js:299:18)
at ShortcutInfo.toString (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\ShortcutInfo.js:49:35)
at C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\TwaManifest.js:205:67
at Array.map ()
at Object.generateShortcuts (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\TwaManifest.js:205:37)
at eval (lodash.templateSources[0]:34:11)
at TwaGenerator.applyTemplate (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\TwaGenerator.js:179:55)
```
Because the shortcut name seems to be displayed the `name` key rather than `shortName` key on apps.
Contributor guide
Assessment
This issue has not been assessed yet.