Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Add option to pass custom mattermost URL #174

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eyalzek
Copy link

@eyalzek eyalzek commented Sep 23, 2020

the regex /^https:\/\/([^/]+\.mattermost|mattermost\.[^/]+|[^/]+\.mattermost\.[^/]+)/ doesn't work when one is using a custom url for their mattermost instance. This PR adds an options page where a user can configure their custom mattermost url.

Fixes #156

This probably still needs a documentation update. Also this doesn't work entirely at the moment since rollout is omitting necessary parentheses in the if condition which results in:
if (url === undefined || res.mattermost_url !== "" && !url.startsWith(res.mattermost_url) || res.mattermost_url === "" && !/^https:\/\/([^/]+\.mattermost|mattermost\.[^/]+|[^/]+\.mattermost\.[^/]+)/.test(url)) return;

instead of:
if (url === undefined || (res.mattermost_url !== "" && !url.startsWith(res.mattermost_url)) || (res.mattermost_url === "" && !/^https:\/\/([^/]+\.mattermost|mattermost\.[^/]+|[^/]+\.mattermost\.[^/]+)/.test(url))) return;

any tips as to how to resolve this are welcome, this is not my normal eco system.

the regex
`/^https:\/\/([^/]+\.mattermost|mattermost\.[^/]+|[^/]+\.mattermost\.[^/]+)/`
doesn't work when one is using a custom url for their mattermost
instance. This PR adds an options page where a user can configure their
custom mattermost url.
Fixes ivangabriele#156
@eyalzek eyalzek changed the title Add options to pass custom mattermost URL Add option to pass custom mattermost URL Sep 23, 2020
chrome complains about:
```
"browser_specific_settings": {
    "gecko": {
      "id": "{bf9b59a1-eccf-4f1c-88f5-a20ebebc4a0b}"
    }
  },
```

but this is necessary on firefox for using the storage api...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin says it's disabled, and has access to the site
1 participant