Rocky_Mountain_Vending/.pnpm-store/v10/files/e7/6065ba93a3d5ae1468803e33eeb06806db7143638513409347c675453c616027301181e5a96ff85730be5115279127c3aeda6adaafb5589f42ed6d4b6e2bf7
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

65 lines
No EOL
2.2 KiB
Text

/**
* Copyright 2025 Google LLC.
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { InvalidWebExtensionException, UnsupportedOperationException, NoSuchWebExtensionException, } from '../../../protocol/protocol.js';
/**
* Responsible for handling the `webModule` module.
*/
export class WebExtensionProcessor {
#browserCdpClient;
constructor(browserCdpClient) {
this.#browserCdpClient = browserCdpClient;
}
async install(params) {
switch (params.extensionData.type) {
case 'archivePath':
case 'base64':
throw new UnsupportedOperationException('Archived and Base64 extensions are not supported');
case 'path':
break;
}
try {
const response = await this.#browserCdpClient.sendCommand('Extensions.loadUnpacked', {
path: params.extensionData.path,
});
return {
extension: response.id,
};
}
catch (err) {
if (err.message.startsWith('invalid web extension')) {
throw new InvalidWebExtensionException(err.message);
}
throw err;
}
}
async uninstall(params) {
try {
await this.#browserCdpClient.sendCommand('Extensions.uninstall', {
id: params.extension,
});
return {};
}
catch (err) {
if (err.message ===
'Uninstall failed. Reason: could not find extension.') {
throw new NoSuchWebExtensionException('no such web extension');
}
throw err;
}
}
}
//# sourceMappingURL=WebExtensionProcessor.js.map