Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
webfolderio committed Apr 30, 2017
0 parents commit 3f7faf9
Show file tree
Hide file tree
Showing 420 changed files with 41,750 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/dependency-reduced-pom.xml
/.settings
/target
/.classpath
/.project
/src/test/java/io/webfolder/cdp/sample/Generator.java
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 WebFolder OÜ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
cdp4j - Chrome Remote Debugging Protocol for Java
=================================================

[![License](http://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)

cdp4j is a web-automation library for Java. It can be used for automating the use of web pages and for testing web pages.
It use Google Chrome Remote Debugging Protocol to automate Chrome & Chromium based browsers.

Supported Java Versions
-----------------------

Oracle & OpenJDK Java 8.

Both the JRE and the JDK are suitable for use with this library.

Licensing
---------

cdp4j is released under the terms of the MIT License (MIT).
You are free to use cdp4j or any of its constituent parts in any other project (even commercial projects) so long as its copyright headers are left intact.

Stability
---------
This library is suitable for use in production systems.

Download
--------
[Pre built jar file](https://webfolder.io/cdp4j-1.0.0.jar) (722 KB).
[source jar file](https://webfolder.io/cdp4j-1.0.0-sources.jar) (495 KB).


Supported Platforms
-------------------
cdp4j has been tested under Windows 10 and Ubuntu, but should work on any platform where a Java & Chrome/Chromium available.

Headless Mode
-------------
Ui4j can be run in "headless" mode using with [Headless Chrome](https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md).

Javadoc
-------
[cdp4j api](https://webfolder.io/cdp4j/index.html)

Logging
-------
Simple logger for Java (SLF4J) is supported.

Usage Examples
--------------
```java
import io.webfolder.cdp.Launcher;
import io.webfolder.cdp.command.DOM;
import io.webfolder.cdp.session.Session;
import io.webfolder.cdp.session.SessionFactory;

public class HelloWorld {

public static void main(String[] args) {
SessionFactory factory = new Launcher().launch();

try (Session session = factory.create()) {
session.navigate("https://webfolder.io");
session.waitDocumentReady();
DOM dom = session.getCommand().getDOM();
Integer root = dom.getDocument().getNodeId();
String content = dom.getOuterHTML(root);
System.out.println(content);
}

factory.close();
}
}
```

Building cdp4j
--------------
mvn install

Getting help and getting involved
---------------------------------
cdp4j is a free software but you must buy support package for bug & improvment report. Unfortunately there is no free support.
Please [contact us](https://webfolder.io/support) for support packages & pricing.
181 changes: 181 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.webfolder</groupId>
<artifactId>cdp4j</artifactId>
<version>1.0.0</version>
<licenses>
<license>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
<description>cdp4j - Chrome Debugging Protocol for Java</description>
<inceptionYear>2017</inceptionYear>
<organization>
<name>WebFolder OÜ</name>
<url>https://webfolder.io</url>
</organization>
<developers>
<developer>
<name>WebFolder</name>
<email>[email protected]</email>
<timezone>GMT+2</timezone>
<organization>WebFolder OÜ</organization>
<url>https://webfolder.io</url>
<organizationUrl>https://webfolder.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createSourcesJar>true</createSourcesJar>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-Description>cdp4j - Chrome Debugging Protocol for Java</Bundle-Description>
<Bundle-Version>${project.version}</Bundle-Version>
<Built-By>WebFolder OÜ</Built-By>
</manifestEntries>
</transformer>
</transformers>
<relocations>
<relocation>
<pattern>com.google.gson</pattern>
<shadedPattern>io.webfolder.cdp.internal.gson</shadedPattern>
</relocation>
<relocation>
<pattern>com.neovisionaries.ws.client</pattern>
<shadedPattern>io.webfolder.cdp.internal.ws</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<header>com/mycila/maven/plugin/license/templates/MIT.txt</header>
<properties>
<owner>WebFolder OÜ</owner>
<email>[email protected]</email>
</properties>
<excludes>
<exclude>README</exclude>
<exclude>COPYING.md</exclude>
<exclude>LICENSE</exclude>
<exclude>pom.xml</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>generate-sources-for-shade-plugin</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<failOnError>false</failOnError>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.neovisionaries</groupId>
<artifactId>nv-websocket-client</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>javapoet</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.com.robust-it</groupId>
<artifactId>cloning</artifactId>
<version>1.9.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
</project>
Loading

0 comments on commit 3f7faf9

Please sign in to comment.