It actually works fine with some minor tweaks.
- First create a second TextureRect node.
- change its texture to "CanvasTexture".
- under "Ordering" increase it's Z index to 1.
- change it's material to your shader and drop the shader code onto it.
- Then near the top of the shader code add this line:
- uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
and viola: