Archive for the ‘browser’ Category

No Comments

Keeping the old TinyMCE editor while upgrading to WordPress 5.0

Sunday, December 30th, 2018

WordPress 5 has introduced a new block editor. Playing with the layout is easier this way, but on the other hand, writing a new post should not take more time than typing the text. Layout should be in the theme.

I guess competition from other website-hosting companies like wix.com, yola.com, weebly.com and jimdo.com is the culprit here. They all offer drop and drag editors for layout. No need for any knowledge of HTMl and CSS, or PHP. A noob should do the job apparently. And now WordPress is following. Designing without a developer is the new thing.

Not sure if I like that, WordPress has better performance with a minimum of plugins, and is CSS not handled better in CSS files?

If you’re used to the old, and why not, it’s working fine, just add this to your function file:

add_filter('use_block_editor_for_post_type', 'atys_disable_block_editor');
function atys_disable_block_editor($use_block_editor) {
return false;
}

The new block editor is another example that progress is not necessarily an improvement for all. Some will be scared by all the changes, speaking for myself: I think I will switch to a markdown editor sooner or later.

Less is more. For now, the old editor is OK.

No Comments

Security by design: following the right principle

Friday, April 6th, 2018

Since there was some attention to a CSS driven keylogger, it’s good again to point out the security risks of third party content. That risk is huge.

When a third party CSS Stylesheet can steal your password, it would be a piece of cake for any Javascript script to do the same.

If you follow this blog, it will not surprise you that we’re skeptical to all the JavaScript driven frameworks that are fashionable. In general Javascript is bad for security, privacy, and the planet 🙂 : battery usage. It’s good for tracking, fingerprinting and advertisements, and visual eye-candy.

Yes, JavaScript can be nice, but please adhere to these old principles: graceful degradation and progressive enhancement. And it’s fashionable not to follow those principles.

Don’t force JavaScript, because you’re trying to sell adds, or track users.

Don’t overdo JavaScript: an URL with your contact info should have your contact info (in HTML). Otherwise you should point to another URL. Don’t hide this information behind Javascript and in JSON somewhere. You’re breaking the internet. Keep information accessible.

It’s important to underline again. Every script that is loaded with <script> has access to the DOM, and if the page is a login page, it has access to the password and username.

So a simple principle can be deducted, and it’s a shame that we have to repeat it here.

Never add any (third party) script to a login page. NEVER.

Nobody should be authorized to have access to a plain password, except for the user. Nobody. Limit access by design, not by trust.

(more…)

No Comments

Web-extension compatibility in the cookieStore

Tuesday, January 9th, 2018

Since Firefox embraced the Web-extension API, life is easier for developers: extensions should be compatible with Chrome, Opera, Firefox, Edge, and Firefox Mobile.

So Firefox Android became my favorite mobile browser, because it’s the first mobile browser to support extensions. Well, there was a lab version of Opera Mobile (Presto), but that died even earlier then Presto died, unfortunately.

But it’s not all sunshine. There are quirks, and incompatibilities in webextensions. Of course you would say. And I’m talking about more then just the chrome/browser name-space differences.

Take cookies and cookiestores.

cookies.getAllCookieStores()

Browser vendors use different storeId’s, but do not really document it.

Chromium/Opera/Chrome storeId ‘s

  • “0” for default windows
  • “1” for private windows

Firefox uses different storeId’s

  • “firefox-default” for normal windows
  • “firefox-private” for private windows.

How to set a cookie

Here some examples to evade the cookie-wall of Volkskrant.nl newspaper by setting cookies.

For a default Firefox window

browser.cookies.set(
 { url: "https://www.volkskrant.nl",domain: ".volkskrant.nl", name: "nl_cookiewall_version", value:"1", storeId:"firefox-default"}
 );

For a Firefox private window

browser.cookies.set(
 { url: "https://www.volkskrant.nl",domain: ".volkskrant.nl", name: "nl_cookiewall_version", value:"1", storeId:"firefox-private"}
 );

For a Chromium/Opera/Chrome default window

chrome.cookies.set(
 { url: "https://www.volkskrant.nl",domain: ".volkskrant.nl", name: "nl_cookiewall_version", value:"1", storeId:"0"}
 );

For a Chromium/Opera/Chrome private window

chrome.cookies.set(
 { url: "https://www.volkskrant.nl",domain: ".volkskrant.nl", name: "nl_cookiewall_version", value:"1", storeId:"1"}
 );

 

 

6 Comments

openVPN on Ubuntu, fixing import errors

Sunday, October 22nd, 2017

You can run into trouble importing an .ovpn config file in Ubuntu, while the same file is imported without any problem in Android.

Somehow when there are unknown or not-supported sections in the config file, importing in Ubuntu will fail with this rather obscure error:

The file 'vpn.ovpn' could not be read or does not contain recognized VPN connection information

Error: the plugin does not support import capability.

The solution is to manually edit the openvpn.ovpn file in a text editor and fix it.

In my case the openvpn.ovpn config file suffered from 2 problems:

  • connections were double defined
  • a <dh> tag was includes, which shouldn’t be in a client file

Fixing the openvpn.ovpn file import

Following these steps will fix the import of openvpn.ovpn config files in Ubuntu 16.04 LTS. Open the openvp.ovpn in a text-editor.

  1. Delete the complete <dh> tag.
  2. When you have multiple <connection> tags, it won’t import. Remove the TCP connection tag completely:
    <connection>
    remote <ip> 443 tcp-client
    </connection
  3. The edit the remaining connection tag by removing the surrounding tags, simply unXML it.
    <connection>
    remote <ip> 1194 udp
    </connection>
    to
    remote <ip> 1194 udp

Save your file and import it.

  1. Edit connections
  2. Add
  3. Scroll down
  4. Import a saved vpn connection
  5. create
  6. Select the edited openvpn.ovpn file
  7. Done!

Explanation

The Diffie Hellman Parameters are only needed for the server, so this is a bug in  the openvpn server that creates the client config file. Still the import script should skip this setting instead of choking on it.

Then the multiple connection issue: Most openvpn servers will accept connections over UPD (preferred setting), but will offer a fallback over TCP when the client is behind a firewall that doesn’t allow UDP. This will happen now and then. The TCP port is the same as the https port, so that port is always open. It seems the network manager doesn’t allow multiple connection setup, although it can use a TCP connection. If you need TCP as a fallback just setup two connections:

  1. OpenVPN UDP
  2. OpenVPN TCP

And choose what you need in your network settings, this is probably the best solution. And actually easier then changing method inside the the profile settings, like you should do in Android.

You probably need to replace tcp-client with tcp, and remove the connection tag:

remote <ip> 443 tcp

Happy and safe networking!

No Comments

Sorting with grid

Wednesday, April 12th, 2017

A while ago we showed you a way to use flexbox for sorting lists and tables. This month the powerful CSS Grid layout system went unprefixed in all major browsers.

In short Grid is for two dimension grids, while Flexbox is better suited for one dimensional layouts, like a nav bar. They can work together, a grid cell can be a flexbox container and vice versa.

The grid system is rather easy to grasp, it doesn’t have much surprises.

Let’s go over to the sorting trick:

Just push the buttons or table header to sort the stuff.

How does it work

Sort the elements on text and write the grid order attribute for CSS.

<li style="grid-row-start: 7;">scstqehfr</li>

The main `win` of css sorting is you don’t need to modify the DOM, which is expensive in most browsers. That said, you need some CSS trickery to get tables look like tables at the moment a tbody has a grid or flexbox display-layout.

Read more about the Basic concepts of grid layout here.

4 Comments

Install Android browsers without Google Play

Monday, March 13th, 2017

Android is the most used operating system for phones. Unfortunately software updates for android phones are not always available nowadays, so the only way to keep your phone secure and up-to-date, is to use a community driven version of Android.

Well, Android is open source, so you can always build something like LineageOS to get a recent version of Android for your device.

I certainly can recommend that. Even older phones are running quite nice, especially when all the proprietary (Samsung/Google) stuff is not installed. Don’t flash GAPPS and your phone feels like new.

Of course that means you don’t have something like Google Maps, but safety has a price, and to be honest, OsmAnd Maps is an excellent replacement.

Software for Android phones outside Google Play store

So now you have a recent LineageOS Android version on your phone, now you need software. You can use the F-Droid repository full of FOSS (Free and Open Source Software).

F-Droid

Opera Browser for Android outside the Google Play Store

You can find the Opera Browser, both the Mini, Mobile and the Opera Android version here:

https://www.opera.com/mobile/download/versions/

Firefox Browser for Android outside the Google Play Store

Firefox for Android is the only mobile browsers that has support for extensions. I can really recommend it.

You can find the Firefox browser, the apk package  here:

https://www.mozilla.org/en-US/firefox/android/all/

If you want to try out a beta version of Firefox for Android, you can find it here:

https://www.mozilla.org/en-US/firefox/android/beta/all/

And Firefox Aurora, the nightly builds:

https://www.mozilla.org/en-US/firefox/android/aurora/all/

When you use Android AOSP, you can have a hard time finding the right browser for your device. Don’t ask me why, but all those links are more or less unfindable, because they are hidden from search-engines.

<meta name="robots" content="noindex">

Hope we can help.

Android AOSP is a great operating system for phones, and more or less the only way to use an Android Phone safe and secure for more then two years.

UPDATE

Firefox seems to change/hide direct download links for their Android browser. I guess Google is making the rules, and forbids public downloads.

Google is getting a pain in the ass here, why are they discouraging people to run 100% transparent open source software: Google that behavior is doing evil!.

There is always the FDroid Firefox version, I can recommend that.
https://f-droid.org/packages/org.mozilla.fennec_fdroid/

And of course there is the public development on Github, which offers releases as well:

https://github.com/mozilla-mobile/fenix/releases