Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
safelinks-cleaner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
safelinks
safelinks-cleaner
Commits
17c78161
Commit
17c78161
authored
3 years ago
by
David Byers
Browse files
Options
Downloads
Patches
Plain Diff
Emit beta versions for firefox as artifacts #force-build:firefox
parent
d61fe9ad
No related branches found
No related tags found
1 merge request
!11
Resolve "Add Barracuda URLs"
Pipeline
#38394
passed
3 years ago
Stage: prepare
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+3
-0
3 additions, 0 deletions
.gitlab-ci.yml
shared/links.js
+15
-5
15 additions, 5 deletions
shared/links.js
with
18 additions
and
5 deletions
.gitlab-ci.yml
+
3
−
0
View file @
17c78161
...
...
@@ -196,6 +196,9 @@ build:firefox:beta:
-
firefox/**/*
when
:
always
-
when
:
never
artifacts
:
paths
:
-
safelinks-cleaner-firefox-beta.xpi
build:firefox:release
:
stage
:
build
...
...
This diff is collapsed.
Click to expand it.
shared/links.js
+
15
−
5
View file @
17c78161
...
...
@@ -23,11 +23,20 @@
/**
*
R
egexp that match
es
safe links. The original URL must be
collected
* in match group 1.
*
List of r
egexp
s
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment