Created
September 18, 2013 16:10
-
-
Save zefer/6611501 to your computer and use it in GitHub Desktop.
A bit of a bodge way to test JS fallback behaviour on old browsers like IE8, using PhantomJS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.geolocation = undefined; | |
window.FormData = undefined; | |
window.getComputedStyle = undefined; | |
window.matchMedia = undefined; | |
window.FileReader = undefined; | |
window.Worker = undefined; | |
window.WebSocket = undefined; | |
window.requestAnimationFrame = undefined; | |
window.performance = undefined; | |
window.EventSource = undefined; | |
window.File = undefined; | |
window.FileError = undefined; | |
window.FileList = undefined; | |
window.FileReader = undefined; | |
window.FileReaderSync = undefined; | |
window.MSStream = undefined; | |
window.MSStreamError = undefined; | |
window.MSStreamReader = undefined; | |
window.ObjectURLOptions = undefined; | |
window.URL = undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context 'using an old browser (IE8)', driver: :poltergeist_pretend_ie8 do | |
pending 'still works' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Poltergeist with some JS APIs removed to pretend to sniffers that it's IE8 | |
Capybara.register_driver :poltergeist_pretend_ie8 do |app| | |
Capybara::Poltergeist::Driver.new(app, | |
extensions: ['spec/support/ie8_spoofer.js'] | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment