Compare commits

..

No commits in common. "master" and "v2.0.6" have entirely different histories.

9 changed files with 3767 additions and 8226 deletions

View File

@ -1,64 +0,0 @@
# Changelog
## 2025-01-03 - 2.0.8 - fix(core)
Ensure consistent browser automation functionality
- Verified browser initialization and shutdown
- Tested PDF generation from web pages
- Validated screenshot capturing
## 2025-01-02 - 2.0.7 - fix(dependencies)
Update dependencies to latest versions.
- Updated @push.rocks/smartpdf dependency to version ^3.1.8
- Updated @push.rocks/smartunique dependency to version ^3.0.9
- Updated devDependencies to the latest versions
## 2024-05-29 - 2.0.6 - Project Maintenance
Minor project maintenance updates.
- Updated project description
- Revised tsconfig settings
- Made repeated updates to npmextra.json focusing on 'githost' configuration
## 2023-07-11 - 2.0.5 - Organizational Updates
Switch to new organizational scheme and internal updates.
- Transitioned project to new organizational scheme
## 2022-10-26 - 2.0.4 to 2.0.2 - Core Fixes
A series of core fixes were applied to ensure better stability and performance.
## 2022-03-24 - 2.0.1 to 2.0.0 - Core Improvements
Significant updates made to the core functionality.
- Updated core components to enhance performance and reliability
## 2021-11-07 - 1.0.22 to 1.0.21 - Core Fixes
Minor fixes to core components for improved stability.
## 2021-04-29 - 1.0.20 to 1.0.18 - Core Fixes
Routine updates and fixes for core stability.
## 2020-06-01 - 1.0.16 to 1.0.14 - Bug Fixes
Multiple bug fixes and enhancements to the core.
## 2019-06-04 - 1.0.13 to 1.0.11 - Bug Fixes
Addressed several core issues to improve functionality.
## 2019-05-29 - 1.0.10 to 1.0.6 - Core Updates
Numerous updates and fixes were applied to core functionalities.
## 2017-04-09 - 1.0.5 to 1.0.3 - Feature Enhancements
Introduced new features and enhancements.
- Added .reload() method
- Included npmextra.json for better configuration management
## 2016-09-20 - 1.0.1 to 1.0.0 - Initial Release and Improvements
Launched the project with several improvements and setup configurations.
- Initial project setup and configuration
- Enhanced README for better documentation
- Integrated GitLab CI for continuous integration

View File

@ -5,24 +5,12 @@
"gitzone": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"githost": "gitlab.com",
"gitscope": "push.rocks",
"gitrepo": "smartbrowser",
"description": "A simplified Puppeteer wrapper for easy automation and testing tasks.",
"description": "puppeteer wrapper for easy tasks",
"npmPackagename": "@push.rocks/smartbrowser",
"license": "MIT",
"keywords": [
"puppeteer",
"automation",
"testing",
"pdf generation",
"screenshot",
"web scraping",
"browser automation"
]
"license": "MIT"
}
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

View File

@ -1,7 +1,7 @@
{
"name": "@push.rocks/smartbrowser",
"version": "2.0.8",
"description": "A simplified Puppeteer wrapper for easy automation and testing tasks.",
"version": "2.0.6",
"description": "simplified puppeteer",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
@ -12,26 +12,26 @@
},
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartbrowser.git"
"url": "git+ssh://git@gitlab.com/pushrocks/smartbrowser.git"
},
"author": "Lossless GmbH",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/pushrocks/smartbrowser/issues"
},
"homepage": "https://code.foss.global/push.rocks/smartbrowser",
"homepage": "https://gitlab.com/pushrocks/smartbrowser#README",
"dependencies": {
"@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartpdf": "^3.1.8",
"@push.rocks/smartpdf": "^3.0.16",
"@push.rocks/smartpuppeteer": "^2.0.0",
"@push.rocks/smartunique": "^3.0.9"
"@push.rocks/smartunique": "^3.0.6"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.2.0",
"@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^1.0.90",
"@push.rocks/tapbundle": "^5.5.4",
"@types/node": "^22.10.4"
"@git.zone/tsbuild": "^2.1.70",
"@git.zone/tsrun": "^1.2.46",
"@git.zone/tstest": "^1.0.81",
"@push.rocks/tapbundle": "^5.0.15",
"@types/node": "^20.6.0"
},
"private": false,
"files": [
@ -48,14 +48,5 @@
],
"browserslist": [
"last 1 chrome versions"
],
"keywords": [
"puppeteer",
"automation",
"testing",
"pdf generation",
"screenshot",
"web scraping",
"browser automation"
]
}

11737
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@

129
readme.md
View File

@ -1,114 +1,37 @@
# @push.rocks/smartbrowser
simplified puppeteer
puppeteer wrapper for easy tasks
## Install
To install `@push.rocks/smartbrowser`, use the following npm command:
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartbrowser)
* [gitlab.com (source)](https://gitlab.com/push.rocks/smartbrowser)
* [github.com (source mirror)](https://github.com/push.rocks/smartbrowser)
* [docs (typedoc)](https://push.rocks.gitlab.io/smartbrowser/)
```bash
npm install @push.rocks/smartbrowser --save
```
## Status for master
This will add `@push.rocks/smartbrowser` to your project's dependencies.
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/push.rocks/smartbrowser/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/push.rocks/smartbrowser/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartbrowser)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/push.rocks/smartbrowser)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@push.rocks/smartbrowser)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartbrowser)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartbrowser)](https://lossless.cloud)
## Usage
`@push.rocks/smartbrowser` simplifies interactions with Puppeteer for tasks like generating PDFs or capturing screenshots from webpages. Below are examples illustrating how you can use `@push.rocks/smartbrowser` in your projects.
Use TypeScript for best in class instellisense.
### Getting Started
## Contribution
First, import `SmartBrowser` from `@push.rocks/smartbrowser`:
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
```typescript
import { SmartBrowser } from '@push.rocks/smartbrowser';
```
For further information read the linked docs at the top of this readme.
Then, initialize and start the `SmartBrowser` instance:
```typescript
const smartBrowser = new SmartBrowser();
await smartBrowser.start();
```
### Generating a PDF from a Webpage
You can generate a PDF from any webpage URL. This can be particularly useful for generating reports, invoices, or snapshot captures of web content.
```typescript
// Generate a PDF from a page
const pdfResult = await smartBrowser.pdfFromPage('https://example.com');
console.log(pdfResult.buffer); // This holds the PDF file's buffer
```
### Capturing a Screenshot of a Webpage
Similarly, you can capture a screenshot of a webpage by passing the URL. This is useful for capturing the current state of a web application, for audits, or for keeping visual records.
```typescript
// Capture a screenshot from a page
const screenshotResult = await smartBrowser.screenshotFromPage('https://example.com');
console.log(screenshotResult.buffer); // This is the screenshot's buffer
```
### Evaluating JavaScript on a Webpage
`SmartBrowser` also allows you to evaluate JavaScript on the webpage. This can be useful for scraping data, testing web applications, or automating interactions with webpages.
```typescript
// Evaluate JavaScript on a page
const pageTitle = await smartBrowser.evaluateOnPage('https://example.com', () => {
return document.title; // Gets the title of the page
});
console.log(pageTitle); // Logs the page title to the console
```
### Shutting Down
Once your tasks are complete, it's important to properly shut down the `SmartBrowser` instance to free up resources:
```typescript
await smartBrowser.stop();
```
### Full Example
Combining the above steps, here's a full example of using `@push.rocks/smartbrowser` to generate a PDF and capture a screenshot of a webpage:
```typescript
import { SmartBrowser } from '@push.rocks/smartbrowser';
async function generateWebAssets() {
const smartBrowser = new SmartBrowser();
await smartBrowser.start();
const pdfResult = await smartBrowser.pdfFromPage('https://example.com');
console.log('PDF Generated:', pdfResult.buffer);
const screenshotResult = await smartBrowser.screenshotFromPage('https://example.com');
console.log('Screenshot Captured:', screenshotResult.buffer);
await smartBrowser.stop();
}
generateWebAssets();
```
In this guide, you've learned how to use `@push.rocks/smartbrowser` for common browser automation tasks. Follow this pattern to incorporate web automation into your applications efficiently.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
## Legal
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)

View File

@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @push.rocks/commitinfo
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/smartbrowser',
version: '2.0.8',
description: 'A simplified Puppeteer wrapper for easy automation and testing tasks.'
version: '2.0.6',
description: 'simplified puppeteer'
}

View File

@ -71,6 +71,3 @@ export class SmartBrowser {
return result;
}
}
import { smartpuppeteer } from './smartbrowser.plugins.js';
export { smartpuppeteer };

View File

@ -3,8 +3,8 @@
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},