Skip to content

Commit

Permalink
Fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopo-j committed Jun 30, 2021
1 parent e9a6acc commit 22e9d41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ function composeDownloadURL(params, filename) {
return url;
}

function sanitizeFilename(filename) {
const allowedChars = /[^\w\s\d\-_~,;\[\]\(\).]/g;
return filename.replaceAll(allowedChars, "_");
}

/**
* Callback used by a MutationObserver object in a
* WebEx page containing a registration to download.
Expand Down Expand Up @@ -140,7 +145,7 @@ function addDownloadButtonToViewer(text, params) {
const filename = data.getElementsByTagName("Sequence")[0].textContent;

// Set the recording name as the save name
const savename = `${params.recordName}.mp4`;
const savename = `${sanitizeFilename(params.recordName)}.mp4`;

// Compose the download link of the video
const downloadURL = composeDownloadURL(params, filename);
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Enables downloading of Webex meeting recordings",
"version": "1.3",
"version": "1.3.1",
"permissions": [
"downloads",
"storage",
Expand Down

0 comments on commit 22e9d41

Please sign in to comment.