ICEmobile
  1. ICEmobile
  2. MOBI-869

Restore URL hash fragment when returning from ICEmobile-SX

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: BridgeIt 1.0
    • Fix Version/s: BridgeIt 1.0
    • Component/s: Containers
    • Labels:
      None
    • Environment:
      HTML5, BridgeIt

      Description

      When ICEmobile-SX/BridgeIt returns control to the browser, the URL fragment previously in place must be restored. For instance, if the user is on the page

      http://host.com/myapp.html#camera

      the same URL (including #camera) must be set.

        Activity

        Hide
        Ted Goddard added a comment -

        The difficulty arises because ICEmobile-SX also uses the #fragment for returning values to the browser. This is implemented by passing a parameter "h" containing the hash fragment to be restored to ICEmobile-SX and having ICEmobile-SX echo this parameter in the URL response as a value for "!h".

        Show
        Ted Goddard added a comment - The difficulty arises because ICEmobile-SX also uses the #fragment for returning values to the browser. This is implemented by passing a parameter "h" containing the hash fragment to be restored to ICEmobile-SX and having ICEmobile-SX echo this parameter in the URL response as a value for "!h".
        Hide
        Ted Goddard added a comment -

        Implementation for Android is simply to extract "h" from the parameters, store it, and echo back as "!h" if set.

        Show
        Ted Goddard added a comment - Implementation for Android is simply to extract "h" from the parameters, store it, and echo back as "!h" if set.
        Hide
        Ted Goddard added a comment -

        As an intermediate implementation choice, the previous hash fragment was to be appended to #icemobilesx as #icemobilesx_encodedfragment_, however this still required changes to the ICEmobile-SX app, so an explicit parameter is being used instead.
        This would have required escaping underscores within the encoded fragment as follows:

        function underscoreEscape(str)

        { str = escape(str); str = str.replace(/_/g, '%5F'); return str; }
        Show
        Ted Goddard added a comment - As an intermediate implementation choice, the previous hash fragment was to be appended to #icemobilesx as #icemobilesx_encodedfragment_, however this still required changes to the ICEmobile-SX app, so an explicit parameter is being used instead. This would have required escaping underscores within the encoded fragment as follows: function underscoreEscape(str) { str = escape(str); str = str.replace(/_/g, '%5F'); return str; }
        Hide
        Ted Goddard added a comment -

        Fragment is restored, however the application developer must be aware that BridgeIt commands are recorded in the browser history and can be replayed with JavaScript history APIs.

        Show
        Ted Goddard added a comment - Fragment is restored, however the application developer must be aware that BridgeIt commands are recorded in the browser history and can be replayed with JavaScript history APIs.

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: