1

The following works on Safari (both mobile and desktop) and desktop Chrome, but mobile Chrome seems to ignore it:

body {
  -webkit-filter: blur(4px);
}

(see http://jsfiddle.net/pMPPY/)

Is there a way to blur the contents of a web page that works on mobile Chrome?

EDIT: I initially said it doesn't work on mobile Chrome, but I misspoke. I didn't realize, at the time, that the default Android browser is NOT "mobile Chrome". I meant to say that it doesn't work on the default Android browser. The blurring may work on mobile Chrome (which I just realized is a different app). Unfortunately, that won't help my project since I'm working on a PhoneGap app, so it uses the Android browser engine. Sorry for the confusion.

Troy
  • 21,172
  • 20
  • 74
  • 103

2 Answers2

2

I don't see filter in the list of supported html5 kits on the mobile chrome page: https://developers.google.com/chrome/mobile/docs/overview granted, it is not excluded but it is also not explicitly mentioned.

I did however find this article: Blur effect on the entire webpage

which links to this jsFiddle: http://jsfiddle.net/9qnsz/2/

That successfully blurs the page and doesn't require a toolkit that is unavailable.

It isn't super clean, you just overlay multiple controls and make them semi-transparent, but it might be useful in whatever you want to accomplish.

The contents of the fiddle are:

<div class="container">
<div class="overlay">
    <p>Please register etc etc...</p>
</div>

<form action="javascript:;" class="form0">
    <input type="text" value="Username" />
    <input type="text" value="Password" />
    <button>Submit</button>
</form>
<form action="javascript:;" class="form1">
    <input type="text" value="Username" />
    <input type="text" value="Password" />
    <button>Submit</button>
</form>
<form action="javascript:;" class="form2">
    <input type="text" value="Username" />
    <input type="text" value="Password" />
    <button>Submit</button>
</form>
<form action="javascript:;" class="form3">
    <input type="text" value="Username" />
    <input type="text" value="Password" />
    <button>Submit</button>
</form>
<form action="javascript:;" class="form4">
    <input type="text" value="Username" />
    <input type="text" value="Password" />
    <button>Submit</button>
</form>

.container {
width:500px;
height:500px;
position:relative;
border:1px solid #CCC;
}
form {
    position:absolute;
    left:10px;
    top:10px;
}
form.form0 {
    left:11px;
    top:11px;
    opacity:0.1;
}
form.form1 {
    left:8px;
    top:8px;
    opacity:0.1;
    zoom:1.02;
}
form.form2 {
    left:11px;
    top:11px;
    opacity:0.1;
    zoom:1.01;
}
form.form3 {
    left:9px;
    top:9px;
    opacity:0.2;
}
form.form4 {
    left:11px;
    top:11px;
    opacity:0.1;
}

.overlay {
    width:250px;
    height:250px;
    margin-top:50px;
    margin-left:auto;
    margin-right:auto;
    border:1px solid #666;
/*        background:#FFF;*/
}
Community
  • 1
  • 1
Nathan Tornquist
  • 6,468
  • 10
  • 47
  • 72
0

Your method will work when we land filters in Chrome for Mobile without the need for flags.

I have just tested it off my stable build of Chrome (M27) on a N4 and it works.

Blur working

Kinlan
  • 16,315
  • 5
  • 56
  • 88