Skip to content

Commit

Permalink
fix: browser import and chrome search-engine choice
Browse files Browse the repository at this point in the history
  • Loading branch information
ennioVisco committed Aug 29, 2024
1 parent 3f7c42e commit 67d7c6b
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 24 deletions.
24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,18 @@ fun runtimeArgs(exec: Any) {
val arguments =
listOf(
GARBAGE_COLLECTOR,
// "--add-exports",
// "javafx.graphics/com.sun.glass.ui=ALL-UNNAMED",
// "--add-exports",
// "javafx.graphics/com.sun.glass.utils=ALL-UNNAMED",
// "--add-exports",
// "javafx.graphics/com.sun.javafx.util=ALL-UNNAMED",
// "--add-exports",
// "javafx.base/com.sun.javafx.logging=ALL-UNNAMED",
// "--add-opens",
// "javafx.graphics/com.sun.glass.ui=ALL-UNNAMED",
// "--add-opens",
// "javafx.graphics/com.sun.glass.utils=ALL-UNNAMED"
"--add-exports",
"javafx.graphics/com.sun.glass.ui=ALL-UNNAMED",
"--add-exports",
"javafx.graphics/com.sun.glass.utils=ALL-UNNAMED",
"--add-exports",
"javafx.graphics/com.sun.javafx.util=ALL-UNNAMED",
"--add-exports",
"javafx.base/com.sun.javafx.logging=ALL-UNNAMED",
"--add-opens",
"javafx.graphics/com.sun.glass.ui=ALL-UNNAMED",
"--add-opens",
"javafx.graphics/com.sun.glass.utils=ALL-UNNAMED"
)
when (exec) {
is JavaExec -> exec.jvmArgs(arguments)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kotlin.code.style=official
# Gradle config
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
#org.gradle.configuration-cache=true
org.gradle.warning-mode=all
# Project info
project.name=webmonitor
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/com/enniovisco/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ fun main(args: Array<String>, preloaded: Boolean = false, toFile : Boolean = tru
it.title("Tracking")
val snapshots = tracking(it)

if(snapshots.isEmpty()) {
throw IllegalStateException("Unable to start the browser session.")
}
val grid = generateSpatialModel(snapshots[0])

it.title("Checking")
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/enniovisco/Shared.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.enniovisco

import com.enniovisco.dsl.*
import com.enniovisco.tracking.Browser
import com.enniovisco.dsl.Browser
import io.github.moonlightsuite.moonlight.core.formula.*
import io.github.moonlightsuite.moonlight.formula.*
import io.github.moonlightsuite.moonlight.formula.classic.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.enniovisco.tracking
package com.enniovisco.dsl

/**
* Allowed browsers for webpages tracking
Expand Down
6 changes: 0 additions & 6 deletions src/main/kotlin/com/enniovisco/dsl/Dsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import com.enniovisco.Spec
import com.enniovisco.WebSource
import com.enniovisco.main


/**
* Enum of the supported browsers.
*/
typealias Browser = com.enniovisco.tracking.Browser

class WebMonitor {
var toFile = true
var toConsole = false
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/com/enniovisco/tracking/PageTracker.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.enniovisco.tracking

import com.enniovisco.dsl.Browser
import io.github.oshai.kotlinlogging.*
import org.openqa.selenium.*
import org.openqa.selenium.devtools.events.*
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/enniovisco/tracking/SessionBuilder.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.enniovisco.tracking

import com.enniovisco.dsl.Browser
import org.openqa.selenium.*
import org.openqa.selenium.chrome.*
import org.openqa.selenium.devtools.*
Expand Down Expand Up @@ -49,6 +50,7 @@ class SessionBuilder(
reduceDriverVerbosity()
val options = ChromeOptions()
options.addArguments("--force-device-scale-factor=2.75")
options.addArguments("--disable-search-engine-choice-screen")

if (dims?.width!! < 500 || dims.height < 400) {
initMobileChrome(options, "iPhone 5/SE")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/examples/source.ase.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.enniovisco.*
import com.enniovisco.tracking.Browser
import com.enniovisco.dsl.Browser

// Unfortunately, the frame-size is browser-specific.
// Typically, all browsers have only a vertical frame,
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/examples/source.nyt.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.enniovisco.*
import com.enniovisco.tracking.Browser
import com.enniovisco.dsl.Browser

WebSource.screenWidth = 800 // px
WebSource.screenHeight = 400 // px
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/examples/source.sample.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.enniovisco.*


// Unfortunately, the frame-size is browser-specific.
// Typically, all browsers have only a vertical frame,
// but it would be nice to set a window size based on the inner dimensions,
Expand Down
2 changes: 1 addition & 1 deletion webmonitor.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ command -v kscript >/dev/null 2>&1 || source /dev/stdin <<< "$(curl -L https://g
exec kscript $0 "$@"
\*** IMPORTANT: Any code including imports and annotations must come after this line ***/

@file:DependsOn("com.enniovisco:webmonitor:1.2.0")
@file:DependsOn("com.enniovisco:webmonitor:1.3.0")

import com.enniovisco.dsl.*

Expand Down

0 comments on commit 67d7c6b

Please sign in to comment.