ext-opera-upload
v1.0.1
Published
Package for uploading opera extensions.
Downloads
9
Maintainers
Readme
ext-opera-upload
Package for uploading Opera extensions programmatically by automating the Opera Addons Developer Dashboard using Puppeteer.
This library exposes a single async function, extOperaUpload, which can:
- upload a new package version (
uploadaction) - verify access to a package (
verifyaction) - submit a package for moderation/publishing (
publishaction)
It navigates the developer UI, performs email/password authentication, uploads the .zip/.crx package, and, on demand, clicks the “Submit for moderation” action.
Note: If Google account-based SSO or reCAPTCHA appears, the function will reject with a descriptive error so your pipeline can handle it.
IMPORTANT
Before you create an issue, please check a list of the known limitations below.
Stack
- Language: JavaScript (CommonJS)
- Types: TypeScript declaration file provided (
index.d.ts) - Runtime: Node.js
- Automation: Puppeteer (bundled Chromium)
- Package manager: npm (
package-lock.jsonpresent)
Requirements
- Node.js 18 or newer
- Puppeteer v24.x requires Node 18+.
- Network access to https://addons.opera.com/ and related auth endpoints.
- An Opera Addons developer account with password authentication enabled (not only Google SSO). If Google SSO is required, the library will abort with an error.
OS support: Puppeteer supports Windows/macOS/Linux. Ensure any OS-level dependencies for headless Chromium are present (mostly relevant on Linux CI images).
Installation
npm install ext-opera-uploadUsage
JavaScript (CommonJS)
const { extOperaUpload, OperaUploadAction } = require('ext-opera-upload');
(async () => {
try {
await extOperaUpload({
packageId: 'YOUR_PACKAGE_ID',
email: process.env.OPERA_EMAIL,
password: process.env.OPERA_PASSWORD,
packagePath: 'path/to/your-extension.zip',
action: OperaUploadAction.UPLOAD, // or VERIFY, PUBLISH
});
console.log('Success');
} catch (err) {
console.error('Failed:', err.message);
process.exitCode = 1;
}
})();TypeScript
Types are included via index.d.ts.
import { extOperaUpload, OperaUploadAction, OperaUploadOptions } from 'ext-opera-upload';
async function run() {
const options: OperaUploadOptions = {
packageId: 'YOUR_PACKAGE_ID',
email: process.env.OPERA_EMAIL!,
password: process.env.OPERA_PASSWORD!,
packagePath: 'path/to/your-extension.zip',
action: OperaUploadAction.UPLOAD, // or VERIFY, PUBLISH
};
await extOperaUpload(options);
}
run().catch((e) => {
console.error(e);
process.exit(1);
});Options
packageId(string) – The Opera Addons package ID.email(string) – Developer account email.password(string) – Developer account password.packagePath(string) – Path to the extension archive (zip or crx) to upload.debug(boolean) – Enable headful debugging. Defaults tofalse.action("verify" | "upload" | "publish") – Behavior:verify: Only verifies access by loading the package page and then exits (requires onlyemailandpasswordparams).upload: Uploads a new extension package. Does not auto-submit for moderation.publish: Uploads a new extension package and then clicks “Submit for moderation”.
How to get the packageId?
- Go to https://addons.opera.com/developer/
- Click on your extension
- Copy the package ID from the URL:
https://addons.opera.com/developer/package/PACKAGE_ID/
Behavior and Errors to Expect
- If Google SSO is required, the library rejects with:
Account needs to have a password authentication enabled!. - If reCAPTCHA Enterprise is detected in headless mode, the library rejects with:
Recaptcha test detected!. - On upload failures (e.g., server flashes an error), the library tries to surface the visible error message from the page.
Scripts (package.json)
npm run format– prettier reformat.npm run format:check– check if code matches prettier formatting.npm run test– placeholder (exits with error). No test suite is provided yet. See Tests section below.
Dev tools:
- Prettier is configured via
prettier.config.cjs(no npm script currently wired).
Project Structure
./ext-opera-upload
├─ README.md # This file
├─ index.js # Library implementation (CommonJS)
├─ index.d.ts # TypeScript types (actions & options)
├─ package.json # Package metadata and dependencies
├─ package-lock.json # npm lockfile
├─ prettier.config.cjs # Prettier configuration
└─ node_modules/ # Installed dependencies (Puppeteer, etc.)Entry points
- Main:
index.js - Types:
index.d.ts
Tests
There are currently no automated tests in this repository.
- Current
npm testis a placeholder.
Known Limitations
- reCAPTCHA Enterprise challenges cannot be solved automatically, the function aborts to avoid hanging pipelines.
- Accounts that rely solely on Google SSO are not supported; a password-based login must be enabled for the Opera account.
- Headful debugging is not configurable via API at the moment, but can be enabled by setting the
DEBUGvariable totruein theindex.jsfile - only for development purposes.
Support me
If you like this project, please consider buying me a coffee: https://buymeacoffee.com/fatidian1
License
MIT License
Copyright (c) 2025 Tymoteusz Abramek
Related docs
- Puppeteer docs: https://pptr.dev/
- Opera Addons developer dashboard: https://addons.opera.com/developer/
