Open belonesox opened 6 months ago
The next version may implement this solution:
Options Page > Standalone Editor > JavaScript
const saveFile = async (saveAs = false) => {
try {
let text = await editor.getValue();
let encoding = $encoding.value;
let l = languages.find(l => l.id == $language.value);
let mime = l && l.mimetypes && l.mimetypes[0] || 'application/octet-stream';
let ext = l && l.extensions && l.extensions[0] || '.txt';
if (!saveAs && $name.value.startsWith('code-editor://')) {
await codeEditor.sendMessage('saveData', {
source: $name.value,
value: text,
mime,
});
+ let match = $name.value.match(/^code-editor:\/\/frame-(\d+)-(\d+)\//);
+ if (match) await browser.tabs.update(parseInt(match[1]), { active: true });
} else {
Also not sure if it possible, but would be great to have some button that returns/activate firefox tab with associated textarea.