-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: open external links with a target attribute like plain external …
…links
- Loading branch information
Showing
4 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
plugin-core/src/main/java/appland/webviews/OpenExternalTargetLinksHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package appland.webviews; | ||
|
||
import org.cef.browser.CefBrowser; | ||
import org.cef.browser.CefFrame; | ||
import org.cef.handler.CefLifeSpanHandlerAdapter; | ||
|
||
/** | ||
* Links with 'target="_blank"' are not passed by JCEF to our external link handler. | ||
* This handler takes care of links with a target. | ||
*/ | ||
public final class OpenExternalTargetLinksHandler extends CefLifeSpanHandlerAdapter { | ||
@Override | ||
public boolean onBeforePopup(CefBrowser browser, CefFrame frame, String target_url, String target_frame_name) { | ||
return OpenExternalLinksHandler.openExternalLink(target_url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters