Skip to content
Snippets Groups Projects
Commit 17c78161 authored by David Byers's avatar David Byers
Browse files

Emit beta versions for firefox as artifacts #force-build:firefox

parent d61fe9ad
No related branches found
No related tags found
1 merge request!11Resolve "Add Barracuda URLs"
Pipeline #38394 passed
......@@ -196,6 +196,9 @@ build:firefox:beta:
- firefox/**/*
when: always
- when: never
artifacts:
paths:
- safelinks-cleaner-firefox-beta.xpi
build:firefox:release:
stage: build
......
......@@ -23,11 +23,20 @@
/**
* Regexp that matches safe links. The original URL must be collected
* in match group 1.
* List of regexps that match safe links. The original URL must be
* collected in match group 1.
*/
const safelinksRegexp = new RegExp(
const regexpList = [
'https?://[^.]+[.]safelinks[.]protection[.]outlook[.]com/[?]url=([^&]+)&.*',
'https?://linkprotect[.]cudasvc[.]com/url[?]a=([^&]+)&.*'
];
/**
* Concatenated regexp for all safe links types.
*/
const safelinksRegexp = new RegExp(
'(?:' + regexpList.map((string) => '(?:' + string + ')').join('|') + ')',
'gi'
);
......@@ -51,9 +60,10 @@ const safelinksPopupVisibleClass = 'safelinks-cleaner-thunderbird-popup-visible'
*/
function untangleLink(link) {
return link.replaceAll(
safelinksRegexp, (match, url) => {
safelinksRegexp,
(match, ...url) => {
try {
return decodeURIComponent(url);
return decodeURIComponent(url.find((el) => el));
}
catch (e) {
return url;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment