# Connecting JabRef Portable to sandboxed web browser

**URL:** <https://discourse.jabref.org/t/connecting-jabref-portable-to-sandboxed-web-browser/3928>\
**Category:** Help\
**Created:** [August 11, 2023, 1:05pm UTC](https://discourse.jabref.org/t/connecting-jabref-portable-to-sandboxed-web-browser/3928 "2023-08-11T13:05:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon79891533](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@anon79891533](https://discourse.jabref.org/u/anon79891533)\
**Post date:** [August 11, 2023, 1:05pm UTC](https://discourse.jabref.org/t/connecting-jabref-portable-to-sandboxed-web-browser/3928/1 "2023-08-11T13:05:43Z")

</div>

JabRef 5.9, Linux Portable, out of any sandboxes  
Linux Manjaro 23.0.0  
Jabref-extension in Vivaldi, latter one as Linux native package, not sandboxed  
Jabref-extension in Firefox, and Chromium both sandboxed (Snap)

Those browsers here sandboxed in snap app don’t get connected to JabRef-app. Not sandboxed Vivaldi connects to JabRef app with no problems.  
First idea was confinement of browser snap app to be forming a barrier for JabRef to browser connection, however no apparmor=“DENIED” logs related to web-browsers in use and at time period corresponding to test were found in journal log (systemd).

- How to troubleshot further?

- Is it true

for file org.jabref.jabref.json to be placed in file tree sub-folder named `native-messaging-hosts` in Mozilla Firefox case while for Chromium/Chrome and all its derivatives the sub-folder name needs to be `NativeMessagingHosts` if the configuration is desired to be valid only for selected user account?

- Is native messaging host interface an implementation of JabRef-team?

```auto
[user@pc230]$ tree --filelimit=6 /opt/jabref-5.9/
/opt/jabref-5.9/
├── bin
│ └── JabRef
└── lib
    ├── app
    │ └── JabRef.cfg
    ├── jabrefHost.py
    ├── JabRef.png
    ├── libapplauncher.so
    ├── native-messaging-host
    │ ├── chromium
    │ │ ├── bifehkofibaamoeaopjglfkddgkijdlh.json
    │ │ └── org.jabref.jabref.json
    │ └── firefox
    │ └── org.jabref.jabref.json
    └── runtime
        ├── bin [19 entries exceeds filelimit, not opening dir]
        ├── conf
        │ ├── logging.properties
        │ ├── net.properties
        │ ├── sdp
        │ │ └── sdp.conf.template
        │ ├── security
        │ │ ├── java.policy
        │ │ ├── java.security
        │ │ └── policy
        │ │ ├── limited
        │ │ │ ├── default_local.policy
        │ │ │ ├── default_US_export.policy
        │ │ │ └── exempt_local.policy
        │ │ ├── README.txt
        │ │ └── unlimited
        │ │ ├── default_local.policy
        │ │ └── default_US_export.policy
        │ └── sound.properties
        ├── legal [44 entries exceeds filelimit, not opening dir]
        ├── lib [40 entries exceeds filelimit, not opening dir]
        └── release

17 directories, 21 files

```

```auto
[user@pc230]$ cat ~/.mozilla/native-messaging-hosts/org.jabref.jabref.json 
{
  "name": "org.jabref.jabref",
  "description": "JabRef",
  "path": "/opt/jabref-5.9/lib/jabrefHost.py",
  "type": "stdio",
  "allowed_extensions": [
    "browserextension@jabref.org",
    "@jabfox"
  ]
}

```

```auto
[user@pc230]$ cat ~/.config/google-chrome/NativeMessagingHosts/org.jabref.jabref.json 
{
  "name": "org.jabref.jabref",
  "description": "JabRef",
  "path": "/opt/jabref-5.9/lib/jabrefHost.py",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://bifehkofibaamoeaopjglfkddgkijdlh/",
    "chrome-extension://pgkajmkfgbehiomipedjhoddkejohfna/"
  ]
}

```

```auto
[user@pc230 ~]$ cat ~/.config/chromium/NativeMessagingHosts/org.jabref.jabref.json 
{
  "name": "org.jabref.jabref",
  "description": "JabRef",
  "path": "/opt/jabref-5.9/lib/jabrefHost.py",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://bifehkofibaamoeaopjglfkddgkijdlh/",
    "chrome-extension://pgkajmkfgbehiomipedjhoddkejohfna/"
  ]
}

```

```auto
[user@pc230 ~]$ cat ~/.mozilla/native-messaging-hosts/jabref_browser_extension.log 
[user@pc230 ~]$

```

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [August 11, 2023, 1:41pm UTC](https://discourse.jabref.org/t/connecting-jabref-portable-to-sandboxed-web-browser/3928/2 "2023-08-11T13:41:13Z")

</div>

Snap packages are _sandboxed_ so that they run in a constrained environment, isolated from the rest of the system. They are designed that way. For them this is a feature, not a bug, as it’s supposed to be very secure. See here: [A guide to snap permissions and interfaces | Ubuntu](https://ubuntu.com/blog/a-guide-to-snap-permissions-and-interfaces).

There are possibilities to grant special permissions to interact with these snaps via “slots”. I don’t know exactly how to do it and have not done this before, but I think, if you dig a little, you will find how to do it.

At least, if we assume, what you experience is caused by the sandboxing.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [August 11, 2023, 5:26pm UTC](https://discourse.jabref.org/t/connecting-jabref-portable-to-sandboxed-web-browser/3928/4 "2023-08-11T17:26:01Z")

</div>

The browser uses native messaging to connect to JabRef, It’s a cross platform browser standard:

> **[Native messaging - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging)**
>
> Native messaging enables an extension to exchange messages with a native application, installed on the user's computer. The native messaging serves the extensions without additional accesses over the web.

And on linux the jabrefHost.py script is the communication endpoint  
[https://github.com/JabRef/jabref/blob/main/buildres/linux/jabrefHost.py](https://github.com/JabRef/jabref/blob/main/buildres/linux/jabrefHost.py)

The browser extensions’s code is here [GitHub - JabRef/JabRef-Browser-Extension: Browser extension for JabRef to allow importing of new items directly from the browser.](https://github.com/JabRef/JabRef-Browser-Extension)

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [August 14, 2023, 5:57pm UTC](https://discourse.jabref.org/t/connecting-jabref-portable-to-sandboxed-web-browser/3928/7 "2023-08-14T17:57:19Z")

</div>

You might want to check the docs about the manual configuration [Browser Extension - JabRef](https://docs.jabref.org/collect/jabref-browser-extension)
