├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .npmignore ├── .travis.yml ├── API_COMPAT.md ├── BUILD.md ├── CONTRIBUTING.md ├── CREDITS.md ├── Dockerfile ├── LICENSE ├── README.md ├── buildpackage.sh ├── docs ├── Makefile ├── api │ ├── cookie.rst │ ├── fs.rst │ ├── js-standard.rst │ ├── phantom.rst │ ├── require.rst │ ├── slimer.rst │ ├── system.rst │ ├── webpage.rst │ └── webserver.rst ├── conf.py ├── configuration.rst ├── differences-with-phantomjs.rst ├── faq.rst ├── index.rst ├── installation.rst ├── make.bat ├── manual │ ├── addons.rst │ ├── frames-manipulation.rst │ └── http-authentication.rst ├── quick-start.rst ├── release-notes-0.10.rst ├── release-notes-0.6.rst ├── release-notes-0.7.rst ├── release-notes-0.8.rst ├── release-notes-0.9.rst ├── release-notes-1.0.rst └── script-execution.rst ├── examples ├── async_await.js ├── phantomjs │ ├── README.md │ └── loadspeed.js └── screenshot_server.js ├── package.json ├── src ├── IMPLEMENTATION_DOC.md ├── LICENSE ├── README.md ├── application.ini ├── chrome.manifest ├── chrome │ ├── branding │ │ ├── content │ │ │ ├── about.png │ │ │ ├── icon48.png │ │ │ └── icon64.png │ │ └── locale │ │ │ ├── brand.dtd │ │ │ └── brand.properties │ ├── icons │ │ └── default │ │ │ ├── default32.png │ │ │ ├── default48.png │ │ │ └── slimerjswin.ico │ └── slimerjs │ │ ├── content │ │ ├── slimerjs.css │ │ ├── slimerjs.js │ │ ├── slimerjs.png │ │ ├── slimerjs.xul │ │ ├── webpage.js │ │ └── webpage.xul │ │ └── locale │ │ └── en-US │ │ └── slimerjs.dtd ├── components │ ├── ConsoleAPI.js │ ├── DisableAddonManager.js │ ├── DisabledTelemetryStartup.js │ ├── SiteSpecificUserAgent.js │ ├── SiteSpecificUserAgent.manifest │ ├── callPhantom.js │ ├── commandline.js │ ├── filePicker.js │ ├── helperAppDialog.js │ ├── httpd.js │ ├── httpd.manifest │ ├── httpd.xpt │ ├── navigation.js │ └── nsPrompter.js ├── defaults │ └── preferences │ │ ├── debug.js │ │ └── prefs.js ├── macos │ └── Info.plist ├── modules │ ├── addon-sdk │ │ ├── sdk │ │ │ ├── base64.js │ │ │ ├── clipboard.js │ │ │ ├── core │ │ │ │ ├── disposable.js │ │ │ │ ├── heritage.js │ │ │ │ ├── namespace.js │ │ │ │ └── promise.js │ │ │ ├── deprecated │ │ │ │ ├── api-utils.js │ │ │ │ ├── app-strings.js │ │ │ │ ├── cortex.js │ │ │ │ ├── errors.js │ │ │ │ ├── events.js │ │ │ │ ├── events │ │ │ │ │ └── assembler.js │ │ │ │ ├── light-traits.js │ │ │ │ ├── list.js │ │ │ │ ├── memory.js │ │ │ │ ├── observer-service.js │ │ │ │ ├── tab-browser.js │ │ │ │ ├── traits.js │ │ │ │ ├── traits │ │ │ │ │ └── core.js │ │ │ │ ├── unit-test-finder.js │ │ │ │ ├── unit-test.js │ │ │ │ └── window-utils.js │ │ │ ├── io │ │ │ │ ├── byte-streams.js │ │ │ │ ├── file.js │ │ │ │ └── text-streams.js │ │ │ ├── net │ │ │ │ ├── url.js │ │ │ │ └── xhr.js │ │ │ ├── notifications.js │ │ │ ├── platform │ │ │ │ └── xpcom.js │ │ │ ├── querystring.js │ │ │ ├── selection.js │ │ │ ├── self.js │ │ │ ├── system.js │ │ │ ├── system │ │ │ │ ├── environment.js │ │ │ │ ├── events.js │ │ │ │ ├── globals.js │ │ │ │ ├── runtime.js │ │ │ │ ├── unload.js │ │ │ │ └── xul-app.js │ │ │ ├── timers.js │ │ │ ├── url.js │ │ │ └── util │ │ │ │ ├── array.js │ │ │ │ ├── collection.js │ │ │ │ ├── deprecate.js │ │ │ │ ├── list.js │ │ │ │ ├── object.js │ │ │ │ ├── registry.js │ │ │ │ └── uuid.js │ │ ├── toolkit │ │ │ └── loader.js │ │ └── xul-app.jsm │ ├── coffee-script │ │ ├── LICENSE │ │ ├── README │ │ ├── extras │ │ │ └── coffee-script.js │ │ ├── lib │ │ │ └── coffee-script │ │ │ │ ├── browser.js │ │ │ │ ├── cake.js │ │ │ │ ├── coffee-script.js │ │ │ │ ├── command.js │ │ │ │ ├── grammar.js │ │ │ │ ├── helpers.js │ │ │ │ ├── index.js │ │ │ │ ├── lexer.js │ │ │ │ ├── nodes.js │ │ │ │ ├── optparse.js │ │ │ │ ├── parser.js │ │ │ │ ├── repl.js │ │ │ │ ├── rewriter.js │ │ │ │ └── scope.js │ │ └── package.json │ ├── hello │ │ ├── people.js │ │ └── world.js │ ├── httpUtils.jsm │ ├── slConfiguration.jsm │ ├── slConsole.jsm │ ├── slCookiesManager.jsm │ ├── slDebug.jsm │ ├── slErrorLogger.jsm │ ├── slExit.jsm │ ├── slLauncher.jsm │ ├── slPhantomJSKeyCode.jsm │ ├── slQTKeyCodeToDOMCode.jsm │ ├── slUtils.jsm │ ├── slimer-sdk │ │ ├── bootstrap.js │ │ ├── net-log.js │ │ ├── path.js │ │ ├── phantom.jsm │ │ ├── slimer.jsm │ │ ├── system.js │ │ ├── vm.js │ │ ├── webpage.js │ │ └── webserver.jsm │ └── webpageUtils.jsm ├── package_exclude.lst ├── phantom-protocol.js ├── slimerjs ├── slimerjs-node ├── slimerjs.bat ├── slimerjs.py └── vendors │ └── ghostdriver │ ├── README.md │ ├── config.js │ ├── errors.js │ ├── ghostdriver.qrc │ ├── hub_register.js │ ├── inputs.js │ ├── lastupdate │ ├── logger.js │ ├── main.js │ ├── request_handlers │ ├── request_handler.js │ ├── router_request_handler.js │ ├── session_manager_request_handler.js │ ├── session_request_handler.js │ ├── shutdown_request_handler.js │ ├── status_request_handler.js │ └── webelement_request_handler.js │ ├── session.js │ ├── third_party │ ├── console++.js │ ├── har.js │ ├── parseuri.js │ ├── uuid.js │ └── webdriver-atoms │ │ ├── active_element.js │ │ ├── clear.js │ │ ├── clear_local_storage.js │ │ ├── clear_session_storage.js │ │ ├── click.js │ │ ├── default_content.js │ │ ├── deps.js │ │ ├── double_click.js │ │ ├── drag.js │ │ ├── execute_async_script.js │ │ ├── execute_script.js │ │ ├── execute_sql.js │ │ ├── find_element.js │ │ ├── find_elements.js │ │ ├── focus_on_element.js │ │ ├── frame_by_id_or_name.js │ │ ├── frame_by_index.js │ │ ├── get_appcache_status.js │ │ ├── get_attribute.js │ │ ├── get_attribute_value.js │ │ ├── get_current_position.js │ │ ├── get_element_from_cache.js │ │ ├── get_frame_window.js │ │ ├── get_in_view_location.js │ │ ├── get_local_storage_item.js │ │ ├── get_local_storage_keys.js │ │ ├── get_local_storage_size.js │ │ ├── get_location.js │ │ ├── get_location_in_view.js │ │ ├── get_session_storage_item.js │ │ ├── get_session_storage_keys.js │ │ ├── get_session_storage_size.js │ │ ├── get_size.js │ │ ├── get_text.js │ │ ├── get_top_left_coordinates.js │ │ ├── get_value_of_css_property.js │ │ ├── get_window_position.js │ │ ├── get_window_size.js │ │ ├── is_displayed.js │ │ ├── is_enabled.js │ │ ├── is_online.js │ │ ├── is_selected.js │ │ ├── lastupdate │ │ ├── move_mouse.js │ │ ├── pinch.js │ │ ├── remove_local_storage_item.js │ │ ├── remove_session_storage_item.js │ │ ├── right_click.js │ │ ├── rotate.js │ │ ├── scroll_into_view.js │ │ ├── scroll_mouse.js │ │ ├── set_local_storage_item.js │ │ ├── set_session_storage_item.js │ │ ├── set_window_position.js │ │ ├── set_window_size.js │ │ ├── submit.js │ │ ├── swipe.js │ │ ├── tap.js │ │ └── type.js │ ├── webdriver_atoms.js │ └── webelementlocator.js ├── test-modules ├── README ├── b.js ├── c.js └── d │ ├── e.js │ └── f.js ├── test ├── a │ ├── accessglobal.js │ ├── b.js │ ├── defineglobal.js │ ├── module_b.js │ ├── other.js │ └── something.json ├── cs │ ├── sample.coffee │ └── sample2.coffee ├── fs │ ├── test.txt │ └── testlatin1.txt ├── injectrequire │ ├── script.js │ └── somemodules │ │ └── myinclude.js ├── jasmine │ ├── MIT.LICENSE │ ├── jasmine-console.js │ ├── jasmine-tap.js │ ├── jasmine.async.min.js │ └── jasmine.js ├── launch-initial-tests.js ├── launch-main-tests.js ├── launch-rendering-tests.js ├── module_a.js ├── module_c.js ├── network-utils.js ├── node_modules │ ├── mynodemodule.js │ └── node_modules │ │ └── subnodemodule.js ├── phantomjs-test-keyevent.js ├── requiredexample.js ├── run_tests ├── test-environment.js ├── test-fs.js ├── test-phantom-cookies.js ├── test-proxy.js ├── test-require.js ├── test-slConsole.js ├── test-system.js ├── test-webpage-callPhantom.js ├── test-webpage-callbacks.js ├── test-webpage-cookies.js ├── test-webpage-download.js ├── test-webpage-filepicker.js ├── test-webpage-frames.js ├── test-webpage-headers.js ├── test-webpage-httpauth.js ├── test-webpage-keyevent-phantom.js ├── test-webpage-keyevent.js ├── test-webpage-keyevent2.js ├── test-webpage-listeners.js ├── test-webpage-loading-files.js ├── test-webpage-longrunningscript.js ├── test-webpage-mouseevent.js ├── test-webpage-navigation.js ├── test-webpage-net-httpcodes.js ├── test-webpage-net-redirections.js ├── test-webpage-onerror.js ├── test-webpage-open.js ├── test-webpage-prompt.js ├── test-webpage-render-bytes.js ├── test-webpage-render-segfault.js ├── test-webpage-render.js ├── test-webpage-request-abort.js ├── test-webpage.js ├── test-webserver.js ├── webserver-for-tests.js ├── www │ ├── alert.html │ ├── background_pattern.png │ ├── callback.html │ ├── callbackclick.html │ ├── charcode.html │ ├── consolemessage.html │ ├── consolemessage.js │ ├── consolemessage2.html │ ├── consolemessageiframe.html │ ├── consolemessagejs.html │ ├── doerror.js │ ├── dummy.js │ ├── example.zip │ ├── filepicker.html │ ├── frame_left.html │ ├── frame_main.html │ ├── frame_top.html │ ├── glouton-home.png │ ├── hello.html │ ├── hello.js │ ├── hello.json │ ├── hello.txt │ ├── helloframe.css │ ├── helloframe.html │ ├── helloworld.html │ ├── inject.html │ ├── longrunningscript.html │ ├── missingresource.html │ ├── mouseevent.html │ ├── navigation.html │ ├── navigation_form.html │ ├── navigator.html │ ├── nothing.js │ ├── onbeforeunload.html │ ├── onerror.html │ ├── render_adaptive.html │ ├── render_fix.html │ ├── rendering │ │ ├── phantomjs_capture_fix_zoomin.png │ │ ├── phantomjs_capture_fix_zoomout.png │ │ ├── rendering_adaptive.html │ │ ├── rendering_fix.html │ │ ├── slimerjs_capture_adapt.png │ │ ├── slimerjs_capture_adapt_clip.png │ │ ├── slimerjs_capture_adapt_clip_zoomin.png │ │ ├── slimerjs_capture_adapt_clip_zoomout.png │ │ ├── slimerjs_capture_adapt_scroll.png │ │ ├── slimerjs_capture_adapt_zoomin.png │ │ ├── slimerjs_capture_adapt_zoomin_scroll.png │ │ ├── slimerjs_capture_adapt_zoomout.png │ │ ├── slimerjs_capture_adapt_zoomout_scroll.png │ │ ├── slimerjs_capture_fix.png │ │ ├── slimerjs_capture_fix_clip.png │ │ ├── slimerjs_capture_fix_clip_zoomin.png │ │ ├── slimerjs_capture_fix_clip_zoomout.png │ │ ├── slimerjs_capture_fix_onlyviewport.png │ │ ├── slimerjs_capture_fix_onlyviewport_scroll.png │ │ ├── slimerjs_capture_fix_onlyviewport_zoomin.png │ │ ├── slimerjs_capture_fix_onlyviewport_zoomin_scroll.png │ │ ├── slimerjs_capture_fix_onlyviewport_zoomout.png │ │ ├── slimerjs_capture_fix_onlyviewport_zoomout_scroll.png │ │ ├── slimerjs_capture_fix_scroll.png │ │ ├── slimerjs_capture_fix_zoomin.png │ │ ├── slimerjs_capture_fix_zoomin_scroll.png │ │ ├── slimerjs_capture_fix_zoomout.png │ │ └── slimerjs_capture_fix_zoomout_scroll.png │ ├── simplehello.html │ ├── slimer.pdf │ ├── slimerjs.png │ ├── subframe_main.html │ ├── subframe_top.html │ ├── typeerror.html │ ├── windowclose.html │ └── windowopen.html └── wwwfile │ ├── inject.js │ ├── injectdoerror.js │ └── injectslimer.js └── website ├── about.html ├── assets ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap.css │ └── docs.css ├── ico │ ├── apple-touch-icon-114-precomposed.png │ ├── apple-touch-icon-144-precomposed.png │ ├── apple-touch-icon-57-precomposed.png │ ├── apple-touch-icon-72-precomposed.png │ └── favicon.png ├── img │ ├── bs-docs-masthead-pattern.png │ ├── bug.png │ ├── bug_bleu.png │ ├── bug_gris.png │ ├── dots.png │ ├── git1.png │ ├── git2.png │ ├── glouton-boy-bigRond.png │ ├── glouton-boy-smallRond.png │ ├── glouton-boy.png │ ├── glouton-boy100.png │ ├── glouton-boy120.png │ ├── glouton-boy120trsp.png │ ├── glouton-boy150trsp.png │ ├── glouton-boyEntete.png │ ├── glouton-boyEntete100.png │ ├── glouton-home.png │ ├── glouton-homeOmbre.png │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ ├── grid-baseline-20px.png │ ├── tchat.png │ ├── tchat2.png │ └── tweet.png └── js │ ├── application.js │ ├── bootstrap.min.js │ ├── google-code-prettify │ ├── prettify.css │ └── prettify.js │ ├── holder │ └── holder.js │ ├── html5shiv.js │ └── jquery.js ├── checksum.html ├── community.html ├── download.html ├── faq.html ├── favicon.ico ├── features.html └── index.html /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | ### versions 3 | 4 | - SlimerJS: 5 | - Firefox: 6 | - Operating system: 7 | 8 | ### Steps to reproduce the issue 9 | 10 | 11 | ### Actual results: 12 | 13 | 14 | ### Expected results: 15 | 16 | 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.komodoproject 3 | *.xpi 4 | _dist 5 | docs/_build/ 6 | misc/ 7 | website/*.gpg 8 | test_reports/ 9 | node_modules 10 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | test/ 3 | test-modules/ 4 | test_reports/ 5 | website/ 6 | .github 7 | BUILD.md 8 | buildpackage.sh 9 | .idea 10 | _dist 11 | 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | services: 2 | - docker 3 | 4 | script: 5 | - docker build . -t slimerjs-test 6 | - docker run -t slimerjs-test 7 | -------------------------------------------------------------------------------- /BUILD.md: -------------------------------------------------------------------------------- 1 | Build official packages 2 | ----------------------- 3 | SlimerJS can run directly from source code. 4 | Go into the src/ directory and run one of slimer.* script, depending 5 | of your platform. This is a convenient way to develop SlimerJS. 6 | 7 | However, distributed packages should be built for releases. 8 | 9 | Call the buildpackage.sh script to build these packages. Works only on an 10 | unix system (Linux and probably MacOS) 11 | 12 | Experimental 13 | ------------ 14 | For Windows packages, you can build a slimerjs.exe from the python 15 | slimerjs.py script. 16 | 17 | We're using pyinstaller. See [documentation to install it](http://pythonhosted.org/PyInstaller/#installing-in-windows) 18 | After installation: 19 | 20 | - run pip-win and give `venv pyi-env-name` as command. A console is opened 21 | - got into the src/ directory of SlimerJS 22 | - then run the command line: `pyinstaller -F -c -n slimerjs slimerjs.py`. See [options here](http://pythonhosted.org/PyInstaller/#options-for-the-executable-output) 23 | - move the dist/slimerjs.exe file to src/ 24 | -------------------------------------------------------------------------------- /CREDITS.md: -------------------------------------------------------------------------------- 1 | 2 | The original author of files of this project, except files provided 3 | by others project or contributors, is Laurent Jouanneau. 4 | 5 | ## Contributors 6 | 7 | ``` 8 | $ git shortlog -s -n | cut -c8- 9 | Laurent Jouanneau 10 | Hallvord R. M. Steen 11 | mark 12 | Wojciech Skorodecki 13 | abozhilov 14 | Thomas Grainger 15 | Kevin Grandon 16 | Will Hilton 17 | Marco Castelluccio 18 | Pavel 19 | Vincent Meurisse 20 | Arpad Borsos 21 | Darren Cook 22 | Ivan Enderlin 23 | Jerry Lundström 24 | Justin Klemm 25 | laurentj 26 | Matthew Kastor 27 | Niek van der Maas 28 | Ricardo Bernardeli 29 | Alexander Tsirel 30 | Artem Sapegin 31 | Avindra Goolcharan 32 | Bartvds 33 | Boris Staal 34 | Brendan Dahl 35 | Brian Birtles 36 | Brian Donovan 37 | Charlie Hulcher 38 | Christoph Burgmer 39 | Delta React User 40 | Emmanuel ROECKER 41 | Eric White 42 | Grahack 43 | Ian McGowan 44 | Jaime Iniesta 45 | James Alastair McLaughlin 46 | Jens Nockert 47 | M Alix 48 | Maciej Brencz 49 | Marc-Aurèle DARCHE 50 | Matt McClure 51 | Mitchell N Charity 52 | Patrick Lucas 53 | Paul Chaplin 54 | Paul Geraghty 55 | Rémi Emonet 56 | Sam Dutton 57 | Stoyko Stanchev 58 | Viktor Nagy 59 | fumitoito 60 | Avadh Patel 61 | Bhuvaneswaran 62 | BitcoinCTF 63 | Dimitar Angelov 64 | Kamron Batman 65 | Kevin Petit 66 | Krzysztof Jurewicz 67 | Kunal Mehta 68 | Mariano Urreta 69 | Nabi KaramAliZadeh 70 | Nagy Attila Gabor 71 | Pavel Evstigneev 72 | Quentin Le Calvez 73 | René Wagner 74 | Sasha Koss 75 | Sergey Kogan 76 | Shannon Little 77 | Sleepydragn1 78 | Tim Gates 79 | falconepl 80 | itsgreggreg 81 | jefleponot 82 | ``` 83 | 84 | See also [contribution graphs on github](https://github.com/laurentj/slimerjs/graphs/contributors). 85 | 86 | ## Other authors 87 | 88 | See the LICENSE file 89 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | 3 | RUN \ 4 | # Use edge repos 5 | echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" > /etc/apk/repositories && \ 6 | echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ 7 | echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories 8 | 9 | RUN \ 10 | # Install Firefox 11 | apk update && apk upgrade && \ 12 | apk add firefox xvfb bash dbus ttf-freefont fontconfig && \ 13 | rm -rf /var/cache/apk/* 14 | 15 | RUN \ 16 | # Create firefox + xvfb runner 17 | mv /usr/bin/firefox /usr/bin/firefox-origin && \ 18 | echo $'#!/usr/bin/env sh\n\ 19 | Xvfb :0 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset & \n\ 20 | DISPLAY=:0.0 firefox-origin $@ \n\ 21 | killall Xvfb' > /usr/bin/firefox && \ 22 | chmod +x /usr/bin/firefox 23 | 24 | # Install slimerjs 25 | COPY . /usr/local/slimerjs 26 | WORKDIR /usr/local/slimerjs 27 | 28 | CMD "test/run_tests" 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The files of this project are licensed under the MPL 2.0 (http://mozilla.org/MPL/2.0/), 2 | with the exception of the components listed below, which are made 3 | available by their authors under the licenses listed alongside. 4 | 5 | * for exceptions in the source code, see src/LICENSE 6 | 7 | * For tests, the Jasmine library is used: 8 | 9 | * test/jasmine/jasmine.js 10 | is released under the MIT Licence. see test/jasmine/MIT.LICENCE 11 | http://pivotal.github.com/jasmine/ 12 | 13 | * test/jasmine/jasmine.async.min.js 14 | is released under the MIT Licence. 15 | https://github.com/derickbailey/jasmine.async 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SlimerJS 2 | http://slimerjs.org/ 3 | 4 | SlimerJS is a scriptable browser. It allows you to manipulate a web page 5 | with an external Javascript script: opening a webpage, clicking on links, modifying the content... 6 | It is useful to do functional tests, page automation, network monitoring, screen capture etc. 7 | 8 | It is a tool like [PhantomJs](http://phantomjs.org/), except that 9 | it runs Gecko instead of Webkit, and it is headless when using Firefox 56+. 10 | It can be used with Firefox 59. 11 | 12 | **Higher version of Firefox is not supported and probably will not be supported 13 | in the future, as the development is suspended for now**. 14 | 15 | 16 | SlimerJS provides the same API of PhantomJS. The current version of SlimerJS 17 | is highly compatible with PhantomJS 2.1. 18 | See current release notes in docs/release-notes-*.rst, and 19 | read the [compatibility table](https://github.com/laurentj/slimerjs/blob/master/API_COMPAT.md) 20 | to know the implementation level. 21 | 22 | The main goal of SlimerJS is to allow to execute all scripts developed for PhantomJS. So 23 | you could use tools like [CasperJS](http://casperjs.org). In fact, CasperJs 1.1 and higher 24 | can be executed with SlimerJS! 25 | 26 | SlimerJS is not only a PhantomJS clone, it contains also [additional features](http://slimerjs.org/features.html). 27 | 28 | Technically, SlimerJS is a XUL/JS application that is launched with 29 | Firefox. 30 | 31 | # Community 32 | 33 | Follow us on twitter: [@slimerjs](https://twitter.com/slimerjs) 34 | 35 | Ask your questions on the dedicated [mailing list](https://groups.google.com/forum/#!forum/slimerjs). 36 | 37 | 38 | # Install SlimerJS, executing a script... 39 | 40 | See documentation into the docs/ directory into the source code, or read 41 | it [on the web site](http://docs.slimerjs.org/current/) 42 | 43 | # FAQ and contribution 44 | 45 | Read the faq into the website/faq.html file or [on the website](http://slimerjs.org/faq.html). 46 | -------------------------------------------------------------------------------- /buildpackage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENTDIR=`pwd` 4 | SLIMERDIR=`dirname $0` 5 | SLIMERDIR=`cd $SLIMERDIR;pwd` 6 | 7 | cd $SLIMERDIR 8 | 9 | VERSION=`grep "^Version=" src/application.ini` 10 | VERSION=${VERSION:8} 11 | 12 | TARGETDIR="$SLIMERDIR/_dist/slimerjs-$VERSION" 13 | 14 | if [ -d "$TARGETDIR" ] 15 | then 16 | rm -rf $TARGETDIR/* 17 | else 18 | mkdir -p "$TARGETDIR" 19 | fi 20 | 21 | # copy files 22 | cd src 23 | 24 | cp application.ini $TARGETDIR 25 | cp slimerjs $TARGETDIR 26 | cp slimerjs.bat $TARGETDIR 27 | cp slimerjs.py $TARGETDIR 28 | cp LICENSE $TARGETDIR 29 | cp README.md $TARGETDIR 30 | cp slimerjs-node $TARGETDIR 31 | cp phantom-protocol.js $TARGETDIR 32 | 33 | 34 | mkdir -p $TARGETDIR/chrome/ 35 | cp -a chrome/icons $TARGETDIR/chrome/ 36 | cp -a vendors $TARGETDIR/ 37 | 38 | # zip chrome files into omni.ja 39 | zip -r $TARGETDIR/omni.ja chrome/ components/ defaults/ modules/ chrome.manifest --exclude @package_exclude.lst 40 | 41 | # set the build date 42 | cd $TARGETDIR 43 | BUILDDATE=`date +%Y%m%d` 44 | sed -i -e "s/BuildID=.*/BuildID=$BUILDDATE/g" application.ini 45 | 46 | # create the final package 47 | cd $SLIMERDIR/_dist 48 | zip -r "slimerjs-$VERSION.zip" "slimerjs-$VERSION" 49 | tar cjf "slimerjs-$VERSION.tar.bz2" "slimerjs-$VERSION" 50 | cd $CURRENTDIR 51 | echo "" 52 | echo "slimerjs-$VERSION.zip and slimerjs-$VERSION.tar.bz2 are in $SLIMERDIR/_dist/" 53 | 54 | -------------------------------------------------------------------------------- /docs/api/cookie.rst: -------------------------------------------------------------------------------- 1 | 2 | ======== 3 | Cookie 4 | ======== 5 | 6 | Some properties and methods of the ``webpage`` and the ``phantom`` object 7 | need a cookie object. 8 | 9 | A cookie object is an object that have these properties: 10 | 11 | - ``name``: the name of the cookie (string) 12 | - ``value``: the value of the cookie (string) 13 | - ``domain``: the domain name on which the cookie is attached 14 | - ``path``: the path in URLs on which the cookie is valid 15 | - ``httponly``: true if the cookie should only be sent to, and can 16 | only be modified by, an HTTP connection (i.e: cannot be read into document.cookie). default: false. 17 | - ``secure``: true if the cookie should only be sent over a secure connection. 18 | - ``expires``: Holds the expiration date, formated in ISO format (for example "2014-10-23" or "2014-10-23T14:48:00"). 19 | This property should be null for cookies existing only during a session. 20 | - ``expiry``: : Holds the expiration date, in milliseconds since the epoch. 21 | This property should be null or 0 for cookies existing only during a session. 22 | 23 | .. _expires: 24 | 25 | Note: there is an inconsistency in PhantomJS 1.9.x. When you set a cookie, ``expiry`` 26 | should be in *milliseconds* since the epoch (1970-01-01), but when you read a cookie, its value 27 | is in *seconds* since the epoch! SlimerJs follows this bad behavior to not break 28 | existing PhantomJs scripts. 29 | 30 | See `webpage.cookies `_, `webpage.addCookie() `_, 31 | `webpage.clearCookies() `_, `webpage.deleteCookie() `_, 32 | `phantom.addCookie() `_, `phantom.clearCookies() `_, 33 | `phantom.cookies `_, `phantom.cookiesEnabled `_, 34 | `phantom.deleteCookie() `_ . 35 | 36 | Storage 37 | ------- 38 | 39 | Cookies are stored in a sqlite database in the mozilla profile. If you want to have 40 | persistent cookies, you cannot indicate a file like for PhantomJS, but you should 41 | create a permanent profile. See `profiles <../configuration.html#profiles>`_. -------------------------------------------------------------------------------- /docs/api/js-standard.rst: -------------------------------------------------------------------------------- 1 | 2 | ============================ 3 | Javascript standard objects 4 | ============================ 5 | 6 | Most Javascript built-in objects are available and can be used as expected, for example, 7 | ``Date``, ``RegExp``, 8 | ``Math``, ``console``... 9 | 10 | XMLHttpRequest 11 | --------------- 12 | 13 | The normal XMLHttpRequest object is not very useful in SlimerJS 14 | because the script is executing from the origin of "about:blank". The 15 | same-origin policy prevents XMLHttpRequest from being used with most 16 | servers. 17 | 18 | To avoid this, we can use the Add-ons SDK version of XMLHttpRequest 19 | which is bundled with SlimerJS, as follows: 20 | 21 | .. code-block:: javascript 22 | 23 | var XMLHttpRequest = require('sdk/net/xhr').XMLHttpRequest; 24 | 25 | This version of XMLHttpRequest is unrestricted; you should avoid using 26 | it on untrusted input as it can fetch anything including local files. 27 | 28 | Note that requests made with this XMLHttpRequest won't call any 29 | network callbacks, but AJAX requests from within loaded web pages will 30 | do so. 31 | 32 | -------------------------------------------------------------------------------- /docs/api/require.rst: -------------------------------------------------------------------------------- 1 | 2 | ======= 3 | require 4 | ======= 5 | 6 | ``require()`` is the function to load a module. See :doc:`the manual ` to know more about modules. 7 | 8 | You should indicate the name of a module (file name without the extension). The module 9 | loader tries to load the module from the directory of the main script, and from directories 10 | indicated into the ``paths`` properties. 11 | 12 | For the module name, it can be a relative path to the current module or the full path of the module file. 13 | 14 | The ``require()`` function has some properties: 15 | 16 | require.paths 17 | ------------- 18 | 19 | This is an array containing path of directories where to find modules. 20 | 21 | 22 | .. code-block:: javascript 23 | 24 | require.paths.push('/home/laurent/my-modules'); 25 | require.paths.push(fs.workingDirectory+'/modules'); 26 | require.paths.push('../other-modules/'); 27 | 28 | Since 0.8.3: you can indicate a relative path as indicated in the CommonJS specification. The real 29 | path is resolved only during the call of ``require()``, and against the path of the module that 30 | do that call. 31 | 32 | require.globals 33 | --------------- 34 | 35 | ``require.globals`` is an object on which you can set properties that will become 36 | global variables in each loaded modules. 37 | 38 | Example: 39 | 40 | .. code-block:: javascript 41 | 42 | require.globals 43 | .thisIsMyGlobalFunction = function() { 44 | return 'hello' 45 | } 46 | 47 | You can then call this function in an other module, like any native function 48 | 49 | .. code-block:: javascript 50 | 51 | var result = thisIsMyGlobalFunction(); 52 | 53 | require.extensions 54 | ------------------ 55 | 56 | SlimerJS supports natively Javascript files, Coffee-Script files and JSON files, with the 57 | require function. 58 | 59 | If you want to support scripts written in an other language (that can be compiled into 60 | javascript), you can then declare the extension of this type of script and the function 61 | that will compile the file. 62 | 63 | .. code-block:: javascript 64 | 65 | var fs = require('fs'); 66 | require.extensions['.myext'] = function (module, filename) { 67 | // here load the file and compile it 68 | var fileContent = fs.read(filename); 69 | var jscontent = .... 70 | 71 | // then give the javascript content to module._compile 72 | module._compile(jscontent, filename); 73 | } 74 | 75 | With this example, you can use require to load modules from files ``*.myext``. 76 | -------------------------------------------------------------------------------- /docs/api/slimer.rst: -------------------------------------------------------------------------------- 1 | 2 | ====== 3 | slimer 4 | ====== 5 | 6 | 7 | ``slimer`` is an object available automatically in scripts. 8 | 9 | 10 | 11 | .. _slimer-clearHttpAuth: 12 | 13 | clearHttpAuth() 14 | ----------------------------------------- 15 | 16 | It clears all HTTP authentication that have been made. Then, when 17 | a webpage needs an HTTP auth, username and password will be asked again. 18 | 19 | See :doc:`doc about http authentication with SlimerJS <../manual/http-authentication>`. 20 | 21 | Introduced: SlimerJS 0.9 22 | 23 | .. _slimer-exit: 24 | 25 | exit() 26 | ----------------------------------------- 27 | 28 | 29 | It stops the script and SlimerJS exit. 30 | 31 | It accepts an optional exit code. Default is 0. 32 | 33 | .. code-block:: javascript 34 | 35 | slimer.exit(); 36 | 37 | 38 | Note: your script may continue to be executed after the call of this method, because of 39 | the asynchronous behavior of this function. 40 | 41 | .. _slimer-isexiting: 42 | 43 | isExiting() 44 | ----------------------------------------- 45 | 46 | Indicate if ``exit()`` has been called. Since the exiting process is asynchronous, 47 | scripts may continues to be executed after exit(). So the script may interrupts its 48 | processing by checking this status 49 | 50 | Introduced: SlimerJS 0.9.4 51 | 52 | .. _slimer-hasfeature: 53 | 54 | hasFeature(featureName) 55 | ----------------------------------------- 56 | 57 | Returns ``true`` if the given feature is implemented **and** enabled. 58 | 59 | It can indicate the state of these features: 60 | 61 | - ``"coffeescript"``: indicates if CoffeeScript is available. It may be 62 | disabled in some case (during GhostDriver execution for example) 63 | 64 | False is returned for all other feature unknown by this method. 65 | 66 | 67 | .. _slimer-version: 68 | 69 | version 70 | ----------------------------------------- 71 | 72 | Contain the version of SlimerJS (read-only). This is an object 73 | containing four properties, ``major``, ``minor``, ``patch`` and ``prerelease``: 74 | 75 | .. code-block:: javascript 76 | 77 | var v = slimer.version; 78 | if (v.prerelease) 79 | console.log('version: ' + v.major + '.' + v.minor + '.' + v.patch + '-' + v.prerelease); 80 | else 81 | console.log('version: ' + v.major + '.' + v.minor + '.' + v.patch); 82 | 83 | 84 | .. _slimer-geckoversion: 85 | 86 | geckoVersion 87 | ----------------------------------------- 88 | 89 | Contain the version of Gecko, the core of Firefox. In fact, this is also 90 | the version of Firefox. 91 | 92 | This is an object containing four properties, ``major``, ``minor``, ``patch`` and ``prerelease``: 93 | 94 | .. code-block:: javascript 95 | 96 | var v = slimer.geckoVersion; 97 | console.log('version: ' + v.major + '.' + v.minor + '.' + v.patch); 98 | 99 | Introduced: SlimerJS 0.9 100 | 101 | .. _slimer-wait: 102 | 103 | wait(milliseconds) 104 | ------------------------------------------ 105 | 106 | SlimerJS do a pause during the given amount of time (in milliseconds). 107 | It can be useful in some case to wait after a reflow or something like that. 108 | Note that it does not freeze the browser. 109 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Welcome to SlimerJS's documentation! 3 | ==================================== 4 | 5 | Manual 6 | ------ 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | 11 | release-notes-1.0 12 | installation 13 | quick-start 14 | script-execution 15 | configuration 16 | differences-with-phantomjs 17 | manual/http-authentication 18 | manual/frames-manipulation 19 | manual/addons 20 | faq 21 | 22 | API reference 23 | ------------- 24 | 25 | Objects and functions available in SlimerJS 26 | 27 | .. toctree:: 28 | :maxdepth: 1 29 | 30 | api/require 31 | api/phantom 32 | api/slimer 33 | api/cookie 34 | 35 | Modules 36 | 37 | .. toctree:: 38 | :maxdepth: 1 39 | 40 | api/webpage 41 | api/system 42 | api/webserver 43 | api/fs 44 | api/js-standard 45 | 46 | Indices and tables 47 | ================== 48 | 49 | * :ref:`genindex` 50 | * :ref:`modindex` 51 | * :ref:`search` 52 | 53 | -------------------------------------------------------------------------------- /docs/release-notes-0.6.rst: -------------------------------------------------------------------------------- 1 | .. index:: Release notes 2 | 3 | 4 | ============================= 5 | Release Notes of SlimerJS 0.6 6 | ============================= 7 | 8 | version 0.6.1 9 | ============= 10 | 11 | SlimerJS 0.6.1 has been released on May 13, 2013. 12 | 13 | Improvements 14 | ------------ 15 | 16 | - Implements phantom.args and phantom.scriptName 17 | 18 | Fixed bugs 19 | ---------- 20 | 21 | - The leading "-" of command line options were troncated and loose their values 22 | - Some functions of the fs module should verify if the given path is empty 23 | - Fixed issue with node-phantom: bad XUL address of webpage.xul (Vincent Meurisse - issue #16) 24 | - Callback of webpage.open was not called after a redirection (issue #22) 25 | - Multiple instance of SlimerJS could not launch at the same time (issue #18) 26 | - On MacOS the relative path of the JS script couldn't be given on the command line (issue #45) 27 | 28 | Fixed PhantomJS conformance issues 29 | ---------------------------------- 30 | 31 | - webpage.evaluate should accepts strings (Vincent Meurisse - issue #20) 32 | - Incorrect case for webpage.evaluateJavaScript (Vincent Meurisse - issue #19) 33 | - Resource id on request/response object should start at 1, not 0 (issue #17) 34 | 35 | version 0.6 36 | =========== 37 | 38 | SlimerJS 0.6 has been released on May 03, 2013. This is the first public stable 39 | release of SlimerJS. 40 | 41 | It is usable, although its API is not still 100% compatible with PhantomJS. 42 | 43 | Missing APIS in SlimerJS 0.6 44 | ---------------------------- 45 | 46 | Here are the PhantomJS APIs that are missing in SlimerJS 0.6. Of course, their 47 | implementation is planed in future releases. 48 | 49 | - most of options for the command line are not supported 50 | - no API to manage HTTP cookies, although cookies are supported (they are stored 51 | automatically) 52 | - no API to manage HTTP headers 53 | - no support of the ``window.callPhantom()`` function in web pages 54 | - no support of the navigation locking 55 | - no support of the ``webpage.offlineStorage*`` properties, although offlineStorage 56 | is supported natively and usable by a web page 57 | - no API to manage child windows 58 | - no support of settings on the webpage and phantomjs object 59 | - ``webpage.open()`` only supports an url and a callback as parameter 60 | - no support of file uploading in web page (``webpage.uploadFile()``, ``webpage.onFilePicker``..) 61 | 62 | You can read the `compatibility table `_ to know details. 63 | 64 | 65 | Known issues 66 | ------------ 67 | 68 | - On MacOS: you must indicate the full path of your JS script on the command line (fixed in 0.6.1) 69 | - CommonJS modules: you cannot alter objects (they are `freezed `_ ) 70 | returned by the ``require()`` function. This is a "feature" of the CommonJS 71 | modules system of the Mozilla Addons SDK (used by SlimerJS). 72 | 73 | -------------------------------------------------------------------------------- /docs/release-notes-1.0.rst: -------------------------------------------------------------------------------- 1 | .. index:: Release notes 2 | 3 | 4 | ============================== 5 | Release Notes of SlimerJS 1.0 6 | ============================== 7 | 8 | version 1.0 9 | =========== 10 | 11 | Released on March 23, 2018. 12 | 13 | New features and API 14 | --------------------- 15 | 16 | - ``loading`` and ``loadingProgress`` properties on webpage 17 | - ``onResourceError`` parameter contains now always ``status`` and ``statusText`` properties 18 | - ``proxy()`` and ``setProxy()`` methods 19 | - ``slimer.version`` and ``slimer.geckoVersion`` have a new ``prerelease`` property. 20 | - With Firefox 56 and more, SlimerJS can be trully headless by adding the ``--headless`` option on the command line 21 | - Proxy config: support https URI for pac 22 | - new ``fs.isSpecial()`` 23 | - ``onResourceRequested``: support of requestData.postData when http method is "patch" 24 | 25 | Improvements 26 | ------------ 27 | 28 | * implements ``system.pid`` (#473) 29 | * implements ``phantom.proxy()`` and ``phantom.setProxy()`` methods (#436, #444, #445) 30 | * Compatibility with Firefox 53 to 59 31 | 32 | Fixed bugs 33 | ---------- 34 | 35 | * Fix error "ReferenceError: reference to undefined property this._stopCallback" 36 | * On Windows: instances launched at the same time don't share anymore the same profile 37 | * On Windows: fix exit code file name 38 | * Remove the error message about "NS_BINDING_ABORTED" 39 | * fix bug in ``fs.isLink()`` and ``fs.readLink()`` 40 | * fix exit code on errors like "script is missing" 41 | 42 | 43 | Fixed PhantomJS conformance issues 44 | ---------------------------------- 45 | 46 | 47 | 48 | Other informations about this release 49 | ------------------------------------- 50 | 51 | 52 | Missing features in SlimerJS 1.0 53 | --------------------------------- 54 | 55 | Comparing to PhantomJS 2.1, some few options for the command line 56 | and features on some object are missing. Among of them: 57 | 58 | - the possibility to deactivate SSL verification and Web security (CORS etc) 59 | - the possibility to set ssl client certificate 60 | - offline storage settings 61 | - the possibility to set a specific cookieJar to each web page object 62 | - listener of repaint events on webpage 63 | - the child_process module 64 | 65 | You can read the `compatibility table `_ 66 | to know details. 67 | 68 | See also :doc:`the differences in APIs and behaviors ` between 69 | SlimerJS and PhantomJS. 70 | 71 | Known issues 72 | ------------ 73 | 74 | - See `the github page `_ ... 75 | 76 | Contributors for this release 77 | ----------------------------- 78 | 79 | - Avadh Patel 80 | - Brian Birtles 81 | - Brendan Dahl 82 | - Nagy Attila Gabor 83 | - Justin Klemm 84 | - Shannon Little 85 | - Wojciech Skorodecki (Proxy API) 86 | 87 | Previous release notes 88 | ====================== 89 | 90 | .. toctree:: 91 | :maxdepth: 1 92 | 93 | release-notes-0.10 94 | release-notes-0.9 95 | release-notes-0.8 96 | release-notes-0.7 97 | release-notes-0.6 98 | 99 | -------------------------------------------------------------------------------- /examples/async_await.js: -------------------------------------------------------------------------------- 1 | const webserver = require("webserver"); 2 | const webpage = require("webpage"); 3 | const system = require('system'); 4 | 5 | const sleep = (ms) => { 6 | return new Promise(resolve => setTimeout(resolve, ms)); 7 | } 8 | 9 | (async () => { 10 | page = webpage.create(); 11 | var isLoading = false; 12 | 13 | page.onLoadStarted = (url, isFrame) => { 14 | console.log(`Loading: ${url}`); 15 | isLoading = true; 16 | }; 17 | 18 | page.onLoadFinished = (status, url, isFrame) => { 19 | console.log(`Loaded ${url} (${status})`); 20 | isLoading = false; 21 | }; 22 | 23 | page.onConsoleMessage = (message, line, file) => { 24 | console.log(`LOG: ${message} -- ${file}:${line}`); 25 | }; 26 | 27 | await page.open('https://news.ycombinator.com'); 28 | 29 | await page.evaluate(() => { 30 | var field = document.querySelector('input[name=q]'); 31 | field.value = "Slimerjs"; 32 | 33 | console.log('Searching "Slimerjs" on HackerNews'); 34 | 35 | field.parentNode.submit(); 36 | }); 37 | 38 | console.log(`Waiting saerch results page to load`); 39 | 40 | while (!page.url.match(/Slimerjs/i) || isLoading || !page.plainText.match(/Slimerjs/i)) { 41 | await sleep(300); 42 | system.stdout.write('.'); 43 | } 44 | system.stdout.write('\n'); 45 | 46 | console.log(`Page content:\n${page.plainText}`); 47 | 48 | slimer.exit(); 49 | })().catch(error => { 50 | if (error.message && error.stack) { 51 | console.log(`Script Error: ${error.constructor.prototype.name}: ${error.message}`); 52 | error.stack.split("\n").forEach(line => { 53 | if (line.trim() != "") { 54 | console.log(` -> ${line}`); 55 | } 56 | }); 57 | } else { 58 | console.log(`Script Error: ${error}`); 59 | } 60 | slimer.exit(1); 61 | }); 62 | -------------------------------------------------------------------------------- /examples/phantomjs/README.md: -------------------------------------------------------------------------------- 1 | Examples in this directory come from [the PhantomJS project](https://github.com/ariya/phantomjs/wiki/Examples), 2 | released under this license: 3 | 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of the nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /examples/phantomjs/loadspeed.js: -------------------------------------------------------------------------------- 1 | var page = require('webpage').create(), 2 | system = require('system'), 3 | t, address; 4 | 5 | if (system.args.length === 1) { 6 | console.log('Usage: loadspeed.js '); 7 | phantom.exit(); 8 | } 9 | 10 | t = Date.now(); 11 | address = system.args[1]; 12 | page.open(address, function (status) { 13 | if (status !== 'success') { 14 | console.log('FAIL to load the address'); 15 | } else { 16 | t = Date.now() - t; 17 | console.log('Loading time ' + t + ' msec'); 18 | } 19 | phantom.exit(); 20 | }); 21 | -------------------------------------------------------------------------------- /examples/screenshot_server.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Web server which takes screenshots of other pages. 3 | * 4 | * To use this web server, you can point your browser at 5 | * http://localhost:9005/ 6 | * 7 | * Alternatively, and more usefully, you can have some other app (e.g. 8 | * a web app) send requests to 9 | * http://localhost:9005/screenshot?url= 10 | * 11 | * The response should be a JPG image. 12 | * 13 | * This script demonstrates the webpage.renderBytes API. 14 | */ 15 | 16 | var webserver = require("webserver"); 17 | var webpage = require("webpage"); 18 | 19 | function handle_root_request(request, response) { 20 | /* 21 | * Serve a minimal html form for the root page. 22 | */ 23 | response.status=200; 24 | response.headers['Content-type'] = 'text/html'; 25 | response.write("" + 26 | "Screenshot API" + 27 | "" + 28 | "
" + 29 | "URL: " + 30 | " "); 31 | response.close(); 32 | } 33 | 34 | function init_page(page) { 35 | // Use this function to set all your favourite settings 36 | // on the webpage objects. 37 | // We could also install event handlers here. 38 | page.settings.userAgent = 'Super Screenshot server'; 39 | var w = 1200; 40 | var h = 800; 41 | page.viewportSize = { width: w, height: h }; 42 | page.clipRect = { top:0, left: 0, width:w, height:h }; 43 | } 44 | 45 | function make_screenshot(request, response, targetUrl) { 46 | var page = webpage.create(); 47 | init_page(page); 48 | page.open(targetUrl, function(status) { 49 | if (status != "success") { 50 | // Fail 51 | response.statusCode = 500; 52 | response.write("SOMETHING FAILED - SORRY"); 53 | response.close(); 54 | } 55 | // Render into a byte array: 56 | var bytes = page.renderBytes( 57 | {"format":"jpg"} 58 | ); 59 | // Set response status and headers etc: 60 | response.statusCode = 200; 61 | response.headers["Content-Type"] = "image/jpeg"; 62 | // This is important: to avoid text conversion etc. 63 | response.setEncoding("binary"); 64 | // Write bytes to the connection. 65 | response.write(bytes); 66 | response.close(); 67 | // Close the page to free resources. 68 | page.close(); 69 | }); 70 | } 71 | 72 | function handle_request(request, response) { 73 | if (request.url == "/") { 74 | return handle_root_request(request, response); 75 | } 76 | 77 | var i = request.url.indexOf("url="); 78 | if (i != -1) { 79 | // Parse url. 80 | var targetUrl = request.url.substring(i + 4); 81 | // decode any special chars etc. 82 | targetUrl = decodeURIComponent(targetUrl); 83 | return make_screenshot(request, response, targetUrl); 84 | } 85 | 86 | response.statusCode = 404; 87 | response.write("NOT FOUND"); 88 | response.close(); 89 | } 90 | 91 | function main() { 92 | var port = 9005; 93 | var svr = webserver.create(); 94 | svr.listen(port, handle_request); 95 | } 96 | 97 | main(); 98 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "slimerjs", 3 | "version": "1.1.0-pre", 4 | "description": "A scriptable browser like PhantomJS, based on Firefox", 5 | "bin": { 6 | "slimerjs": "./src/slimerjs-node" 7 | }, 8 | "main": "./src/phantom-protocol.js", 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/laurentj/slimerjs.git" 12 | }, 13 | "author": "", 14 | "license": "MPL-2.0", 15 | "bugs": { 16 | "url": "https://github.com/laurentj/slimerjs/issues" 17 | }, 18 | "homepage": "https://github.com/laurentj/slimerjs#readme", 19 | "dependencies": {} 20 | } 21 | -------------------------------------------------------------------------------- /src/application.ini: -------------------------------------------------------------------------------- 1 | [App] 2 | Vendor=Innophi 3 | Name=SlimerJS 4 | Version=1.1.0-pre 5 | BuildID=20180323 6 | ID=slimerjs@slimerjs.org 7 | Copyright=Copyright 2012-2018 Laurent Jouanneau & Innophi 8 | 9 | [Gecko] 10 | MinVersion=53.0.0 11 | MaxVersion=59.* 12 | 13 | [XRE] 14 | EnableExtensionManager=1 15 | -------------------------------------------------------------------------------- /src/chrome.manifest: -------------------------------------------------------------------------------- 1 | content slimerjs chrome/slimerjs/content/ 2 | locale slimerjs en-US chrome/slimerjs/locale/en-US/ 3 | resource slimerjs modules/ 4 | 5 | component {00995ba2-223f-4efb-b656-ce98aff7019b} components/commandline.js 6 | contract @mozilla.org/commandlinehandler/general-startup;1?type=slimerjs {00995ba2-223f-4efb-b656-ce98aff7019b} 7 | category command-line-handler m-slimerjscli @mozilla.org/commandlinehandler/general-startup;1?type=slimerjs 8 | 9 | component {fe06cc0a-53d5-4004-a5af-c23b4d2e327d} components/ConsoleAPI.js platformversion<30 10 | contract @mozilla.org/console-api;1 {fe06cc0a-53d5-4004-a5af-c23b4d2e327d} platformversion<30 11 | category JavaScript-global-property console @mozilla.org/console-api;1 platformversion<30 12 | 13 | component {47c45611-1cfe-4f5e-9749-dc5c78ce8b40} components/nsPrompter.js 14 | contract @mozilla.org/prompter;1 {47c45611-1cfe-4f5e-9749-dc5c78ce8b40} 15 | component {d49b3b06-afc2-4f72-9f9e-baffae1a4d8c} components/nsPrompter.js 16 | contract @mozilla.org/network/authprompt-adapter-factory;1 {d49b3b06-afc2-4f72-9f9e-baffae1a4d8c} 17 | component {5598347d-7573-47b9-ae3c-a9c4e3f0e56b} components/nsPrompter.js 18 | contract @mozilla.org/embedcomp/prompt-service;1 {5598347d-7573-47b9-ae3c-a9c4e3f0e56b} 19 | 20 | component {5a5f9d66-53b5-4541-8225-cae868541bc2} components/navigation.js 21 | contract @slimerjs.org/navigation;1 {5a5f9d66-53b5-4541-8225-cae868541bc2} 22 | category content-policy m-slimerjsnav @slimerjs.org/navigation;1 23 | 24 | component {4e2fc2ea-f8b9-456b-a421-71039eb8dcd0} components/callPhantom.js 25 | contract @slimerjs.org/callphantom;1 {4e2fc2ea-f8b9-456b-a421-71039eb8dcd0} 26 | category JavaScript-global-property callPhantom @slimerjs.org/callphantom;1 27 | 28 | component {4d447d76-5205-4685-9237-9a35c7349adf} components/filePicker.js 29 | contract @mozilla.org/filepicker;1 {4d447d76-5205-4685-9237-9a35c7349adf} 30 | 31 | component {04c5992d-c6a5-4138-9b75-b03ead2be0f1} components/helperAppDialog.js 32 | contract @mozilla.org/helperapplauncherdialog;1 {04c5992d-c6a5-4138-9b75-b03ead2be0f1} 33 | 34 | # Disable addons. Not activated yet... 35 | #component {ed6e7c79-fcd3-4285-881e-f0cbb0d8ada0} components/DisabledAddonManager.js 36 | #contract @mozilla.org/addons/integration;1 {ed6e7c79-fcd3-4285-881e-f0cbb0d8ada0} 37 | 38 | # Disable telemetry. 39 | component {b0836913-f33f-4935-96af-235891cd5815} components/DisabledTelemetryStartup.js 40 | contract @mozilla.org/base/telemetry-startup;1 {b0836913-f33f-4935-96af-235891cd5815} 41 | 42 | manifest components/httpd.manifest 43 | manifest components/SiteSpecificUserAgent.manifest 44 | 45 | content branding chrome/branding/content/ 46 | locale branding en-US chrome/branding/locale/ -------------------------------------------------------------------------------- /src/chrome/branding/content/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/src/chrome/branding/content/about.png -------------------------------------------------------------------------------- /src/chrome/branding/content/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/src/chrome/branding/content/icon48.png -------------------------------------------------------------------------------- /src/chrome/branding/content/icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/src/chrome/branding/content/icon64.png -------------------------------------------------------------------------------- /src/chrome/branding/locale/brand.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/chrome/branding/locale/brand.properties: -------------------------------------------------------------------------------- 1 | brandFullName=SlimerJS 2 | brandShortName=SlimerJS 3 | vendorShortName=Innophi 4 | -------------------------------------------------------------------------------- /src/chrome/icons/default/default32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/src/chrome/icons/default/default32.png -------------------------------------------------------------------------------- /src/chrome/icons/default/default48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/src/chrome/icons/default/default48.png -------------------------------------------------------------------------------- /src/chrome/icons/default/slimerjswin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/src/chrome/icons/default/slimerjswin.ico -------------------------------------------------------------------------------- /src/chrome/slimerjs/content/slimerjs.css: -------------------------------------------------------------------------------- 1 | #hauntedwall { 2 | text-align:center; 3 | font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; 4 | text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4), 0px 0px 30px rgba(0, 0, 0, 0.075); 5 | } 6 | 7 | #hauntedwall h2 span { 8 | color: rgb(0, 151, 58); 9 | } 10 | 11 | #hauntedwall h2 { 12 | font-size: 20pt; 13 | color: rgb(59, 59, 60); 14 | } 15 | 16 | #hauntedwall image { 17 | transition-property: width, height, opacity; 18 | transition-duration: 8s; 19 | opacity:0; 20 | width:10px; 21 | height:7px; 22 | } 23 | #hauntedwall:hover image { 24 | opacity:0.9; 25 | width:100px; 26 | height:71px; 27 | } 28 | 29 | #version { 30 | font-size:8pt; 31 | color: #636262; 32 | } 33 | -------------------------------------------------------------------------------- /src/chrome/slimerjs/content/slimerjs.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | */ 5 | 6 | Components.utils.import("resource://gre/modules/Services.jsm"); 7 | 8 | // we need to output to the shell console 9 | Services.prefs.setBoolPref('browser.dom.window.dump.enabled', true); 10 | 11 | Components.utils.import('resource://slimerjs/slLauncher.jsm'); 12 | Components.utils.import('resource://slimerjs/slConfiguration.jsm'); 13 | Components.utils.import('resource://slimerjs/slUtils.jsm'); 14 | Components.utils.import('resource://slimerjs/slExit.jsm'); 15 | 16 | function startup() { 17 | document.getElementById("versionnumber").textContent = Services.appinfo.version 18 | var runtimeIframe = document.getElementById('runtime'); 19 | try { 20 | slLauncher.launchMainScript(runtimeIframe.contentWindow); 21 | } 22 | catch(e) { 23 | dumpex(e, 'Error during the script execution\n'); 24 | dumpStack(e.stack); 25 | slExit.exit(1) 26 | } 27 | } 28 | 29 | function quit() { 30 | slExit.exit(0); 31 | } 32 | -------------------------------------------------------------------------------- /src/chrome/slimerjs/content/slimerjs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/src/chrome/slimerjs/content/slimerjs.png -------------------------------------------------------------------------------- /src/chrome/slimerjs/content/slimerjs.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 20 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /test/www/background_pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/background_pattern.png -------------------------------------------------------------------------------- /test/www/callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | simple hello world 6 | 7 | I call callPhantom 8 | 11 | 12 | -------------------------------------------------------------------------------- /test/www/callbackclick.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | calbback and click - issue 6 | 16 | 17 | 18 |
19 | 31 | 32 | -------------------------------------------------------------------------------- /test/www/consolemessage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test consolemessage 6 | 7 | 13 | 14 | 15 | Hello world 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/www/consolemessage.js: -------------------------------------------------------------------------------- 1 | window.onload = function(event){ 2 | console.log('message from consolemessagejs') 3 | } -------------------------------------------------------------------------------- /test/www/consolemessage2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test consolemessage2 6 | 7 | 13 | 14 | 15 | Hello world 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/www/consolemessageiframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test consolemessageiframe 6 | 7 | 13 | 14 | 15 | Hello world 16 | 17 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/www/hello.js: -------------------------------------------------------------------------------- 1 | var foo=4; 2 | 3 | document.write('

script

'); 4 | 5 | var xhr = new XMLHttpRequest(); 6 | xhr.open('GET', 'hello.txt', true); 7 | xhr.send(); -------------------------------------------------------------------------------- /test/www/hello.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": " 2 | 3 | 4 | 5 | hello in frame 6 | 7 | 8 | 9 |

This is a frame

10 | 11 | -------------------------------------------------------------------------------- /test/www/helloworld.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | hello world 6 | 7 | Hello! 8 | -------------------------------------------------------------------------------- /test/www/inject.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Inject test 5 | 24 | 25 | 26 | 27 |

example

28 |
    29 |
  • aaa
  • 30 |
31 | 32 | -------------------------------------------------------------------------------- /test/www/longrunningscript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Long Running Script 6 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/www/missingresource.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | missing css 6 | 7 | 8 | 9 |

This is a page

10 | 11 | -------------------------------------------------------------------------------- /test/www/mouseevent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test mouse event 6 | 7 | 71 | 81 | 82 | 83 |
84 | Hello world 85 |
86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /test/www/navigation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | navigation 6 | 14 | 15 | 16 | Simple Hello 17 | click 18 | click2 19 | 20 | -------------------------------------------------------------------------------- /test/www/navigation_form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | navigation form 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/www/navigator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bug 373 6 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/www/nothing.js: -------------------------------------------------------------------------------- 1 | function nothing() { } -------------------------------------------------------------------------------- /test/www/onbeforeunload.html: -------------------------------------------------------------------------------- 1 | 2 | foo 3 | 11 | 12 | 13 | Simple Hello 14 | 15 | -------------------------------------------------------------------------------- /test/www/onerror.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | simple hello world 6 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/www/render_adaptive.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | render adaptive 6 | 16 | 17 | 18 |
19 | 20 | -------------------------------------------------------------------------------- /test/www/render_fix.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | render fix 6 | 17 | 18 | 19 |
20 | 21 | -------------------------------------------------------------------------------- /test/www/rendering/phantomjs_capture_fix_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/phantomjs_capture_fix_zoomin.png -------------------------------------------------------------------------------- /test/www/rendering/phantomjs_capture_fix_zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/phantomjs_capture_fix_zoomout.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_clip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_clip.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_clip_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_clip_zoomin.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_clip_zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_clip_zoomout.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_zoomin.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_zoomin_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_zoomin_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_zoomout.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_adapt_zoomout_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_adapt_zoomout_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_clip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_clip.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_clip_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_clip_zoomin.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_clip_zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_clip_zoomout.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_onlyviewport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_onlyviewport.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_onlyviewport_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_onlyviewport_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomin.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomin_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomin_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomout.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomout_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_onlyviewport_zoomout_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_zoomin.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_zoomin_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_zoomin_scroll.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_zoomout.png -------------------------------------------------------------------------------- /test/www/rendering/slimerjs_capture_fix_zoomout_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/rendering/slimerjs_capture_fix_zoomout_scroll.png -------------------------------------------------------------------------------- /test/www/simplehello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | simple hello world 6 | 7 | Hello World! 你好 ! çàéèç 8 | 9 |
invisible text
10 | 11 | -------------------------------------------------------------------------------- /test/www/slimer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/slimer.pdf -------------------------------------------------------------------------------- /test/www/slimerjs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/test/www/slimerjs.png -------------------------------------------------------------------------------- /test/www/subframe_main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sub window frames 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/www/subframe_top.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sub frame top 6 | 7 | top of sub frame 8 | 9 | -------------------------------------------------------------------------------- /test/www/typeerror.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 |

This page should cause a TypeError

11 | -------------------------------------------------------------------------------- /test/www/windowclose.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | window close 6 | 7 | this page tries to close the window 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/www/windowopen.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | window open 6 | 7 | this page tries to open a window 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/wwwfile/inject.js: -------------------------------------------------------------------------------- 1 | document.getElementById("test").setAttribute('class', 'foo'); 2 | 3 | var injectedVariable = 'I am here'; 4 | 5 | pageVariable = "changed it"; -------------------------------------------------------------------------------- /test/wwwfile/injectdoerror.js: -------------------------------------------------------------------------------- 1 | function doInjectError() { 2 | throw new Error("error from injectdoerror.js") 3 | } 4 | 5 | doInjectError(); 6 | -------------------------------------------------------------------------------- /test/wwwfile/injectslimer.js: -------------------------------------------------------------------------------- 1 | 2 | injectedValue = "myvalue"; 3 | 4 | assertEquals("foo", ex.myExample, "value of ex.myExample inside injectslimer.js"); 5 | 6 | var newinjectedvalue = "yes!" -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/ico/favicon.png -------------------------------------------------------------------------------- /website/assets/img/bs-docs-masthead-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/bs-docs-masthead-pattern.png -------------------------------------------------------------------------------- /website/assets/img/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/bug.png -------------------------------------------------------------------------------- /website/assets/img/bug_bleu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/bug_bleu.png -------------------------------------------------------------------------------- /website/assets/img/bug_gris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/bug_gris.png -------------------------------------------------------------------------------- /website/assets/img/dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/dots.png -------------------------------------------------------------------------------- /website/assets/img/git1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/git1.png -------------------------------------------------------------------------------- /website/assets/img/git2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/git2.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boy-bigRond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boy-bigRond.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boy-smallRond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boy-smallRond.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boy.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boy100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boy100.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boy120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boy120.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boy120trsp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boy120trsp.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boy150trsp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boy150trsp.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boyEntete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boyEntete.png -------------------------------------------------------------------------------- /website/assets/img/glouton-boyEntete100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-boyEntete100.png -------------------------------------------------------------------------------- /website/assets/img/glouton-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-home.png -------------------------------------------------------------------------------- /website/assets/img/glouton-homeOmbre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glouton-homeOmbre.png -------------------------------------------------------------------------------- /website/assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /website/assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /website/assets/img/grid-baseline-20px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/grid-baseline-20px.png -------------------------------------------------------------------------------- /website/assets/img/tchat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/tchat.png -------------------------------------------------------------------------------- /website/assets/img/tchat2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/tchat2.png -------------------------------------------------------------------------------- /website/assets/img/tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laurentj/slimerjs/761b43aca99ecde6b17d0838951fe614aeb1ab60/website/assets/img/tweet.png -------------------------------------------------------------------------------- /website/assets/js/application.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function() { 3 | $('.bs-docs-sidenav').affix({ 4 | offset: { 5 | top: function () { return $(window).width() <= 980 ? 290 : 210 } 6 | , bottom: 270 7 | } 8 | }) 9 | //window.prettyPrint && prettyPrint() 10 | }) 11 | -------------------------------------------------------------------------------- /website/assets/js/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .prettyprint .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 20px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /website/assets/js/html5shiv.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); 8 | for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d