Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 'convert-post-to-get-in-xhr' without service worker #178

Merged
merged 8 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
node-version: 18.x
- run: yarn install
- run: yarn run build-full-test
- id: setup-chrome
uses: browser-actions/setup-chrome@v1
# set up a virtual display for chrome (since the tests don't currently run it in headless mode)
# then run the tests
- run: |
- name: Run Tests
env:
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
yarn test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webrecorder/wombat",
"version": "3.8.3",
"version": "3.8.4",
"main": "index.js",
"license": "AGPL-3.0-or-later",
"author": "Ilya Kreymer, Webrecorder Software",
Expand Down
7 changes: 3 additions & 4 deletions src/wombat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4549,7 +4549,9 @@ Wombat.prototype.initHTTPOverrides = function() {
// responseURL override
this.overridePropExtract(this.$wbwindow.XMLHttpRequest.prototype, 'responseURL');

if (!this.wb_info.isSW) {
var convertToGet = !!this.wb_info.convert_post_to_get;

if (!this.wb_info.isSW && !convertToGet) {
if (this.$wbwindow.XMLHttpRequest.prototype.open) {
var origXMLHttpOpen = this.$wbwindow.XMLHttpRequest.prototype.open;
this.utilFns.XHRopen = origXMLHttpOpen;
Expand Down Expand Up @@ -4588,9 +4590,6 @@ Wombat.prototype.initHTTPOverrides = function() {
this.__WB_xhr_headers.set(name, value);
};

var wombat = this;
var convertToGet = !!this.wb_info.convert_post_to_get;

this.$wbwindow.XMLHttpRequest.prototype.send = async function(value) {
if (convertToGet && (this.__WB_xhr_open_arguments[0] === 'POST' || this.__WB_xhr_open_arguments[0] === 'PUT')) {

Expand Down
Loading