Skip to content

Commit

Permalink
[FB] PWA | Fix error problem
Browse files Browse the repository at this point in the history
  • Loading branch information
surapunoyousei committed Oct 30, 2023
1 parent 61fffc2 commit a6e6e72
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions browser/components/PWA/ProgressiveWebAppStartMenuUtils.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,30 @@ export let ProgressiveWebAppStartMenuUtils = {
return Cc["@mozilla.org/browser/shell-service;1"].getService(Ci.nsIWindowsShellService);
},

async createShortCut(shortcutName, targetPath, iconPath) {
async createShortCut(shortcutName, targetPath) {
let shellService = this.shellService;
let exe = `${this.browserInstallationDirectory}\\${AppConstants.MOZ_APP_DISPLAYNAME_DO_NOT_USE.toLowerCase()}.exe`;

if (!iconPath) {
iconPath = exe;
}
let winTaskbar = Cc["@mozilla.org/windows-taskbar;1"].getService(
Ci.nsIWinTaskbar
);
let appdir = Services.dirsvc.get("GreD", Ci.nsIFile);
let exe = appdir.clone();
const PRIVATE_BROWSING_BINARY = `${AppConstants.MOZ_APP_DISPLAYNAME_DO_NOT_USE.toLowerCase()}.exe`
exe.append(PRIVATE_BROWSING_BINARY);

if (!targetPath) {
targetPath = this.startMenuDirectory;
}

console.log(`Creating shortcut for ${exe} in ${targetPath} with icon ${iconPath}`);

await shellService.createShortcut(
exe,
[],
"Floorp Progressive Web App for " + shortcutName,
exe,
icon,
0,
0,
"Progressive Web App",
"Floorp Progressive Web App for " + shortcutName,
winTaskbar.defaultPrivateGroupId,
"Programs",
"Floorp Progressive Web App.lnk",
Services.dirsvc.get("GreD", Ci.nsIFile),
);
},

setIconToShortcut(shortcutPath, iconPath, iconIndex) {

}
};

0 comments on commit a6e6e72

Please sign in to comment.