How to modify the top menu

Hello,

Writing passbolt training content for my users, I would like to be able to add an link into the top menu of the passbolt application so that my users can easily access the url containing my training materials. Do any of you know how to go about it?

Sincerely

Sklaxs

Hi :wave:

To do that, you have to add your link in this file then rebuild the passbolt extension.
Your users will have to install your extension instead of the official one to see your link.

Cheers,

Hello _jc,

Thank you for your answer (I’m surprised that the modification is to be made in the extension). But I will try

Hi,

If you read this help page, you will understand why it has to be done in the extension: Passbolt Help | Why do I need a browser extension?

Most of passbolt UI is rendered by the extension.

Cheers,

Having followed the advice of jc, I modified the file. The modification is well taken into account when I launch the demo via npm run start-app-dev-server but once this is done, I block. How do I generate my extensions for chrome and firefox?

@sklaxs Do you mean this? GitHub - passbolt/passbolt_browser_extension: Passbolt browser extensions (Firefox & Chrome) (from the ReadME in the repo).

Thanks Garrett,

I have successfully modified the module; I just have to have it signed and modify the download links in the application.

I am waiting to be finished to summarize my manipulations.

1 Like

I advance, but I block again.
I managed to modify the module:

git clone GitHub - passbolt/passbolt_browser_extension: Passbolt browser extensions (Firefox & Chrome)
cd passbolt_browser_extension
npm update
grunt copy:styleguide
cd node_modules/passbolt-styleguide/src/
find . -exec sed -i “s#https://help.passbolt.com#https://myurl#g” {} ;
cd …/…/…/src/firefox
grunt build

at this time i can install the extension on firefox dev edition but. It remains to sign the module to install on the standard edition. So, i update “id” and “short_name” in “src/firefox/manifest.json” and in run

Preformatted text`web-ext sign --channel=unlisted --api-key=$AMO_JWT_ISSUER --api-secret=$AMO_JWT_SECRET

Where AMO_JWT_ISSUER is set like user:12345678:123
and AMO_JWT_SECRET is set like: e23dacb…cda23c

(JWT_ISSUER and AMO_JWT_SECRET recover from my firefox account).

but I have this 401 error:

status: 401
response: {“detail”:“Unknown JWT iss (issuer).”}

Hi @sklaxs I’m reading in the Mozilla docs and it says these need to be strings so maybe put quotes around them and try again. (I have not attempted this, but a guess given what you show)

If it’s not a matter of strings, check your machine’s time accuracy. Ref: Unable to sign extensions · Issue #2228 · mozilla/web-ext · GitHub

I revoked my credentials and it passed.

Now I have errors related to the use of “experimental” features

FAIL
WebExtError: The extension could not be signed
    at file:///usr/lib/node_modules/web-ext/lib/cmd/sign.js:97:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Program.execute (file:///usr/lib/node_modules/web-ext/lib/program.js:289:7)
    at async file:///usr/lib/node_modules/web-ext/bin/web-ext.js:13:1

Exemple:

content_scripts/js/app/Login.js line 14 column 1

JavaScript syntax error (Parsing as module error: Unexpected token < at line: 44 and column: 19) (Parsing as script error: ‘import’ and ‘export’ may appear only with ‘sourceType: module’ at line: 14 and column: 1)

Error: There is a JavaScript syntax error in your code, which might be related to some experimental JavaScript features that aren’t an official part of the language specification and therefore not supported yet. The validation cannot continue on this file.

What Node version are you using?

$ node -v
v18.8.0

which version do you recommend?

@max What version is used these days to build it?

Preferably v16.17.1 (Latest LTS: Gallium)

When it comes to node, you need to be very careful. LTS versions provide somewhat of assurance that there are maintainers that are coming back to fix security flaws etc.

It also depends on the developers and what node version they are using to build whatever it is that they are building.

1 Like

Use the one precised in the package.json:

1 Like

@sklaxs when you build, run grunt build from the project folder. It’s not clear from your history notes whether you built in the correct directory or not.