** Tags removed: touch-2014-10-30
** Tags added: touch-2014-11-06

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to webbrowser-app in Ubuntu.
https://bugs.launchpad.net/bugs/1358622

Title:
  webapp container redirection URL trimming breaks links to twitter in
  facebook app

Status in Web Browser App:
  In Progress
Status in “webbrowser-app” package in Ubuntu:
  New

Bug description:
  Consider a facebook post that contains a link to
  "http://t.co/OvsXJpPCtM"; (twitter URL shortener). Facebook encodes
  this link as
  
"http://lm.facebook.com/l.php?u=http%3A%2F%2Ft.co%2FOvsXJpPCtM&h=rAQH6jL54&s=1";,
  which redirects to the original link.

  However calling Qt.openUrlExternally(…) on the encoded link won’t open
  it in the browser (or in the twitter webapp), it will trigger the URL
  dispatcher with the facebook webapp itself. So the actual link needs
  to be extracted from the encoded URL.

  The webapp container already has a mechanism to do that, in the form
  of a --popup-redirection-url-prefix command-line parameter, which
  basically trims the corresponding prefix off an encoded URL. For
  facebook, this prefix is "http://lm.facebook.com/l.php?u=";. So the
  encoded URL is transformed into
  "http%3A%2F%2Ft.co%2FOvsXJpPCtM&h=rAQH6jL54&s=1" and then decoded,
  which gives "http://t.co/OvsXJpPCtM&h=rAQH6jL54&s=1";, which ends up on
  a 404, because of the additional parameters "&h=rAQH6jL54&s=1" that
  were part of the encoded URL, not the original one.

  This prefix mechanism is too simple, we probably need a regexp
  mechanism to properly extract the target URL from the encoded form,
  without leaving trailing parameters.

  Note that in the current release of webapp-container as of today
  (0.23+14.10.20140818.2-0ubuntu1), there is a bug whereby the encoded
  URL is used, not the trimmed one. The following MR fixes this bug, but
  hits the 404 issue with twitter links in facebook posts:
  https://code.launchpad.net/~osomon/webbrowser-app/filter-session-
  storage-url-save/+merge/231204.

To manage notifications about this bug go to:
https://bugs.launchpad.net/webbrowser-app/+bug/1358622/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to