*** This bug is a duplicate of bug 1514484 ***
    https://bugs.launchpad.net/bugs/1514484

Please let me know if I misunderstood and this isn't a duplicate.

** This bug has been marked a duplicate of bug 1514484
   Chromium start-up script doesn't accept argument values with spaces in 
$CHROMIUM_FLAGS, cause is lack of quotes

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to chromium-browser in Ubuntu.
https://bugs.launchpad.net/bugs/1809105

Title:
  Broken setting custom flags in /usr/bin/chromium-browser script

Status in chromium-browser package in Ubuntu:
  New

Bug description:
  To workaround LP#1808853 (https://bugs.launchpad.net/bugs/1808853) I
  tried to make the following script (/etc/chromium-
  browser/customizations/20-chromium-useragent-fix):

  https://gitlab.com/mikhailnov/nastr/blob/master/chromium-useragent-
  fix.sh

  But it does not work due to probably an error in /usr/bin/chromium-
  browser

  If use an unmodified /usr/bin/chromium-browser, then my scripts leads
  to openning multiple tabs, because --useagent=VALUE is passed as
  multiple arguements, not one.

  I've made a patch:
  --- ./chromium-browser  2018-12-17 04:53:00.000000000 +0300
  +++ /tmp/chromium-browser       2018-12-19 14:16:29.186960503 +0300
  @@ -207,16 +207,16 @@
     echo "$GDB $LIBDIR/$APPNAME -x $tmpfile"
     $GDB "$LIBDIR/$APPNAME" -x $tmpfile
     if [ $want_temp_profile -eq 1 ] ; then
  -    rm -rf $TEMP_PROFILE
  +    rm -rf ${TEMP_PROFILE:?}/*
     fi
     exit $?
   else
     if [ $want_temp_profile -eq 0 ] ; then
  -    exec $LIBDIR/$APPNAME $CHROMIUM_FLAGS "$@"
  +    exec "$LIBDIR/$APPNAME" "$CHROMIUM_FLAGS" "$@"
     else
       # we can't exec here as we need to clean-up the temporary profile
  -    $LIBDIR/$APPNAME $CHROMIUM_FLAGS "$@"
  -    rm -rf $TEMP_PROFILE
  +    "$LIBDIR/$APPNAME" "$CHROMIUM_FLAGS" "$@"
  +    rm -rf ${TEMP_PROFILE:?}/*
     fi
   fi

  After this multiple pages are not openned, but, if we run
  $ bash -x /usr/bin/chromium-browser
  we see:
  + exec /usr/lib/chromium-browser/chromium-browser ' 
--ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so 
--ppapi-flash-version=32.0.0.101 --user-agent=Mozilla/5.0 (X11; Linux x86_64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36  
--enable-pinch' https://yandex.ru/internet

  the problem is in ' ', new user-agent is not applied

  If to run manually
  $ /usr/lib/chromium-browser/chromium-browser 
--ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so 
--ppapi-flash-version=32.0.0.101 --user-agent=Mozilla/5.0 (X11; Linux x86_64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36  
--enable-pinch https://yandex.ru/internet

  then setting a custom useragent does work.

  What can be done?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1809105/+subscriptions


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

Reply via email to