Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Provide a way to control how links with target="_blank" / target="_new" are handled so navigation can be kept in the current browser view instead of opening a new window.
  • Expose this behavior as a browser property and default it to following such links (consistent with Android behavior).

Description

  • Add BrowserComponent.BROWSER_PROPERTY_FOLLOW_TARGET_BLANK and wire setBrowserProperty(...) to propagate the setting to platform implementations via setBrowserFollowTargetBlank.
  • iOS: add native void setBrowserFollowTargetBlank(...) in IOSNative.java, implement Objective-C helpers and a native setter in IOSNative.m (using associated objects) with default YES, and update UIWebView/WKWebView navigation handling in UIWebViewEventDelegate.m to loadRequest: and cancel the popup when targetFrame == nil and following is enabled.
  • JavaSE (JavaFX): add a followTargetBlank flag in SEBrowserComponent, register a setCreatePopupHandler(...) that returns the same WebEngine when following is enabled, and honor the property in setProperty.
  • JavaSE (CEF): add a followTargetBlank flag and expose setFollowTargetBlank(...) in BrowserPanel, handle onBeforePopup(...) in the CEF lifespan handler to load the target URL in the same browser when enabled, and wire CEFBrowserComponent.setProperty(...) to set the flag.

Testing

  • No automated tests were run for this change.

Codex Task

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 2, 2026

Compared 30 screenshots: 30 matched.

Native Android coverage

  • 📊 Line coverage: 24.85% (2663/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.47% (12362/50528), branch 15.35% (717/4672), complexity 17.54% (744/4241), method 33.08% (602/1820), class 34.98% (106/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 24.85% (2663/10717 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.47% (12362/50528), branch 15.35% (717/4672), complexity 17.54% (744/4241), method 33.08% (602/1820), class 34.98% (106/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 2, 2026

iOS screenshot updates

Compared 30 screenshots: 23 matched, 6 updated, 1 missing reference.

  • BrowserComponent — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    BrowserComponent
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as BrowserComponent.png in workflow artifacts.

  • graphics-draw-arc — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-arc
    Preview info: JPEG preview quality 20; JPEG preview quality 20; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-arc.png in workflow artifacts.

  • graphics-draw-gradient — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-gradient
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-gradient.png in workflow artifacts.

  • graphics-draw-round-rect — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/graphics-draw-round-rect.png.

    graphics-draw-round-rect
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

  • graphics-draw-string — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 422x918.
    Full-resolution PNG saved as graphics-draw-string.png in workflow artifacts.

  • graphics-draw-string-decorated — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string-decorated
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-string-decorated.png in workflow artifacts.

  • kotlin — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    kotlin
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as kotlin.png in workflow artifacts.

Benchmark Results

  • VM Translation Time: 319 seconds
  • Compilation Time: 262 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 31711 ms
Extract Extensions 21 ms
Google Services Setup 2 ms
Scan Classes 830 ms
Extract Libs 1702 ms
Inject Build Hints 66 ms
Generate Unit Tests 2 ms
Generate Stubs 1480 ms
Compile Stubs 2879 ms
Generate Icons 1325 ms
Prepare ParparVM 206 ms
ParparVM Execution 167962 ms
Post-VM Setup 173 ms
CocoaPods 4836 ms
Finalize 87 ms
Total Time 213283 msMaven Overhead : 106000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot 147000 ms
Simulator Boot (Run) 2000 ms
App Install 11000 ms
App Launch 3000 ms
Test Execution 142000 ms

@shai-almog shai-almog merged commit 17ff80f into master Feb 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants