Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension/chrome/elements/add_pubkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ View.run(
await Ui.modal.warning(`some keys could not be processed due to errors:\n${errs.map(e => `-> ${e.message}\n`).join('')}`);
}
$('.copy_from_email').val('');
$('.pubkey').val(String(KeyUtil.armor(keys[0])));
$('.pubkey').val(KeyUtil.armor(keys[0]));
$('.action_ok').trigger('click');
} else if (errs.length) {
await Ui.modal.error(`error processing public keys:\n${errs.map(e => `-> ${e.message}\n`).join('')}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class ComposeQuoteModule extends ViewModule<ComposeView> {
}
const text = this.messageToReplyOrForward.text;
const from = Str.parseEmail(this.messageToReplyOrForward.headers.from || '').email;
const date = new Date(String(this.messageToReplyOrForward.headers.date));
const date = new Date(this.messageToReplyOrForward.headers.date);
const dateStr = Str.fromDate(date).replace(' ', ' at ');
const rtl = new RegExp('[' + Str.rtlChars + ']').exec(text);
const dirAttr = `dir="${rtl ? 'rtl' : 'ltr'}"`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class ComposeRecipientsModule extends ViewModule<ComposeView> {
this.view.S.now('send_btn_text').text(this.BTN_LOADING);
this.view.sizeModule.setInputTextHeightManuallyIfNeeded();
recipientEl.evaluating = (async () => {
this.view.errModule.debug(`evaluateRecipients.evaluat.recipient.email(${String(recipientEl.email)})`);
this.view.errModule.debug(`evaluateRecipients.evaluat.recipient.email(${recipientEl.email})`);
this.view.errModule.debug(`evaluateRecipients.evaluating.recipient.status(${recipientEl.status})`);
this.view.errModule.debug(`evaluateRecipients.evaluating: calling getUpToDatePubkeys`);
const info = await this.view.storageModule.getUpToDatePubkeys(recipientEl.email);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ export class PgpBlockViewAttachmentsModule {
const size = filesize(attachments[i].length);

const htmlContent = `<b>${Xss.escape(nameVisible)}</b>&nbsp;&nbsp;&nbsp;${size}<span class="progress"><span class="percent"></span></span>`;
const attachment = $(`<a href="#" index="${Number(i)}">`);
const attachment = $(`<a href="#" index="${i}">`);
attachment.attr('title', name);
Xss.sanitizeAppend(attachment, htmlContent);
if (isEncrypted) {
attachment.addClass('preview-attachment');
attachment.attr('data-test', 'preview-attachment');
attachment.append(
`<button class="download-attachment" data-test="download-attachment-${Number(i)}" index="${Number(
i
)}" title="DOWNLOAD"><img src="/img/svgs/download-link-green.svg"></button>`
`<button class="download-attachment" data-test="download-attachment-${i}" index="${i}" title="DOWNLOAD"><img src="/img/svgs/download-link-green.svg"></button>`
); // xss-escaped
} else {
attachment.attr('data-test', `download-attachment-${Number(i)}`);
attachment.attr('data-test', `download-attachment-${i}`);
attachment.addClass('download-attachment');
}
$('#attachments').append(attachment); // xss-escaped
Expand Down
8 changes: 4 additions & 4 deletions extension/css/cryptup.css
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ body#settings > div#content pre {
font-size: 12px;
border-radius: 2px;
white-space: pre-wrap;
word-wrap: break-word;
overflow-wrap: break-word;
}

body#settings > div#content.setup {
Expand Down Expand Up @@ -1391,7 +1391,7 @@ body {
font-size: 0.9rem;
padding: 0;
margin: 0;
word-wrap: break-word;
overflow-wrap: break-word;
}

body#reply_message {
Expand Down Expand Up @@ -2429,7 +2429,7 @@ table#compose td.text div#input_text {
border: none !important;
box-shadow: none !important;
height: 100%;
word-wrap: break-word;
overflow-wrap: break-word;
max-width: 525px;
overflow-y: auto;
min-height: 140px;
Expand Down Expand Up @@ -2537,7 +2537,7 @@ table#compose .intro_container > td > .input_intro {
height: 50px;
box-shadow: none !important;
outline: none;
word-wrap: break-word;
overflow-wrap: break-word;
overflow-y: auto;
}

Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/api/email-provider/gmail/gmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Gmail extends EmailProviderApi implements EmailProviderInterface {
method: 'GET',
data: {
labelIds: labelId !== 'ALL' ? labelId : undefined,
includeSpamTrash: Boolean(labelId === 'SPAM' || labelId === 'TRASH'),
includeSpamTrash: labelId === 'SPAM' || labelId === 'TRASH',
// pageToken: page_token,
// q,
// maxResults
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/api/shared/api-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class AjaxErr extends ApiCallErr {
const redactedPayload = AjaxErr.redactSensitiveData(Catch.stringify(req.data).substring(0, 1000));
stack += `\n\nresponseText(0, 1000):\n${redactedRes}\n\npayload(0, 1000):\n${redactedPayload}`;
}
const message = `${String(xhr.statusText || '(no status text)')}: ${String(xhr.status || -1)} when ${ApiCallErr.describeApiAction(req)} -> ${
const message = `${xhr.statusText || '(no status text)'}: ${String(xhr.status || -1)} when ${ApiCallErr.describeApiAction(req)} -> ${
resMsg || '(no standard err msg)'
}`;
return new AjaxErr(message, stack, status, CatchHelper.censoredUrl(req.url), responseText, xhr.statusText || '(no status text)', resMsg, resDetails);
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/core/crypto/smime/smime-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ export class SmimeKey {
if (!eku) {
return false;
}
return !!(eku as { emailProtection: boolean }).emailProtection;
return (eku as { emailProtection: boolean }).emailProtection;
}

private static dateToNumber(date: Date): undefined | number {
Expand Down
8 changes: 4 additions & 4 deletions extension/js/common/core/mime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class Mime {
const parser = new MimeParser();
const leafNodes: { [key: string]: MimeParserNode } = {};
parser.onbody = (node: MimeParserNode) => {
const path = String(node.path.join('.'));
const path = node.path.join('.');
if (typeof leafNodes[path] === 'undefined') {
leafNodes[path] = node;
}
Expand Down Expand Up @@ -343,7 +343,7 @@ export class Mime {
let from: string | undefined;
const getHdrValAsArr = (hdr: MimeContentHeader) =>
typeof hdr === 'string' ? ([hdr].map(h => Str.parseEmail(h).email).filter(e => !!e) as string[]) : hdr.map(h => h.address);
const getHdrValAsStr = (hdr: MimeContentHeader) => Str.parseEmail((Array.isArray(hdr) ? hdr[0]?.address : String(hdr || '')) || '').email;
const getHdrValAsStr = (hdr: MimeContentHeader) => Str.parseEmail((Array.isArray(hdr) ? hdr[0]?.address : hdr || '') || '').email;
for (const hdrName of headersNames) {
const header = parsedMimeMsg.headers[hdrName];
if (header) {
Expand Down Expand Up @@ -427,13 +427,13 @@ export class Mime {
if (node.headers['content-disposition']?.[0]) {
const header = node.headers['content-disposition'][0];
if (header.params?.filename) {
return String(header.params.filename);
return header.params.filename;
}
}
if (node.headers['content-type']?.[0]) {
const header = node.headers['content-type'][0];
if (header.params?.name) {
return String(header.params.name);
return header.params.name;
}
}
return;
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/message-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ export class MessageRenderer {
signerEmail,
verificationPubs,
result.content,
!!result.isEncrypted,
result.isEncrypted,
result.signature,
renderModule,
this.getRetryVerification(signerEmail, verificationPubs => MessageRenderer.decryptFunctionToVerifyRes(() => decrypt(verificationPubs))),
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/platform/catch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class Catch {
thrown.stack += Catch.formattedStackBlock('Catch.reportErr calling stack', CatchHelper.stackTrace());
if (thrown.hasOwnProperty('workerStack')) {
// https://github.com/openpgpjs/openpgpjs/issues/656#event-1498323188
thrown.stack += Catch.formattedStackBlock('openpgp.js worker stack', String((thrown as Error & { workerStack: string }).workerStack));
thrown.stack += Catch.formattedStackBlock('openpgp.js worker stack', (thrown as Error & { workerStack: string }).workerStack);
}
}
const exception = Catch.formExceptionFromThrown(thrown);
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/ui/backup-ui/backup-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class BackupUi {
private renderPrvKeysBackupSelection = async (kinfos: KeyInfoWithIdentity[]) => {
for (const ki of kinfos) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const email = Xss.escape(String(ki.emails![0]));
const email = Xss.escape(ki.emails![0]);
const dom = `
<div class="mb-20">
<div class="details">
Expand Down
4 changes: 2 additions & 2 deletions extension/js/common/xss-safe-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ export class XssSafeFactory {
const params: UrlParams = {
isReplyBox: true,
frameId: `frame_${Str.sloppyRandom(10)}`,
skipClickPrompt: Boolean(skipClickPrompt),
ignoreDraft: Boolean(ignoreDraft),
skipClickPrompt,
ignoreDraft,
replyMsgId: convoParams.replyMsgId,
draftId: convoParams.draftId,
removeAfterClose: convoParams.removeAfterClose,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export const contentScriptSetupIfVacant = async (webmailSpecific: WebmailSpecifi
await webmailSpecific.start(acctEmail, clientConfiguration, inject, notifications, factory, relayManager);
} catch (e) {
if (e instanceof TabIdRequiredError) {
console.error(`FlowCrypt cannot start: ${String(e.message)}`);
console.error(`FlowCrypt cannot start: ${e.message}`);
} else if (e instanceof Error && e.message === 'Extension context invalidated.') {
console.info(`FlowCrypt cannot start: extension context invalidated. Destroying.`);
win.destroy();
Expand Down
2 changes: 1 addition & 1 deletion extension/js/service_worker/bg-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class BgHandlers {
if (tab.id) {
const message = await messenger.messageDisplay.getDisplayedMessage(tab.id);
if (message?.id) {
return await messenger.messages.getFull(Number(message.id));
return await messenger.messages.getFull(message.id);
}
}
return;
Expand Down
Loading
Loading