Module: Turbo::Session::NavigationDelegateMethods
- Included in:
- Turbo::Session
- Defined in:
- lib/turbo/session/navigation_delegate_methods.rb
Instance Attribute Summary collapse
-
#navigationAction ⇒ Object
Returns the value of attribute navigationAction.
Instance Method Summary collapse
- #externallyOpenableURL ⇒ Object
- #isMainFrameNavigation ⇒ Object
- #policy ⇒ Object
- #shouldOpenURLExternally ⇒ Object
- #shouldReloadPage ⇒ Object
- #webView(webview, decidePolicyForNavigationAction: navigationAction, decisionHandler: decisionHandler) ⇒ Object
Instance Attribute Details
#navigationAction ⇒ Object
Returns the value of attribute navigationAction.
5 6 7 |
# File 'lib/turbo/session/navigation_delegate_methods.rb', line 5 def end |
Instance Method Details
#externallyOpenableURL ⇒ Object
22 23 24 25 26 |
# File 'lib/turbo/session/navigation_delegate_methods.rb', line 22 def externallyOpenableURL if url = .request.url && shouldOpenURLExternally url end end |
#isMainFrameNavigation ⇒ Object
38 39 40 |
# File 'lib/turbo/session/navigation_delegate_methods.rb', line 38 def .targetFrame.isMainFrame if .targetFrame end |
#policy ⇒ Object
18 19 20 |
# File 'lib/turbo/session/navigation_delegate_methods.rb', line 18 def policy . == || ? : end |
#shouldOpenURLExternally ⇒ Object
28 29 30 31 |
# File 'lib/turbo/session/navigation_delegate_methods.rb', line 28 def shouldOpenURLExternally type = . return type == || ( && type == ) end |
#shouldReloadPage ⇒ Object
33 34 35 36 |
# File 'lib/turbo/session/navigation_delegate_methods.rb', line 33 def shouldReloadPage type = . return && type == end |
#webView(webview, decidePolicyForNavigationAction: navigationAction, decisionHandler: decisionHandler) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/turbo/session/navigation_delegate_methods.rb', line 7 def webView(webview, decidePolicyForNavigationAction: , decisionHandler: decisionHandler) = (navigationAction: ) decisionHandler(.policy) if url = .externallyOpenableURL openExternalURL(url) elsif .shouldReloadPage reload end end |