mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 00:25:56 +03:00
[GH-ISSUE #1341] scripting always fails with reference to __mapSwiftArrayToJSObject unless async #1334
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1334
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ddissett on GitHub (Aug 31, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1341
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
Version 3.8.0 (30800)
macOS Version? (Ex. mac 10.14)
10.14.6 (18G9323)
Steps to reproduce
function onRequest(context, url, request) {
console.log(request);
return request;
}
function onResponse(context, url, request, response) {
console.log(response);
return response;
}
Expected behavior
request and/or response on* function is called and request and/or response object is logged to the console what that page is loaded thru the proxy
Screenshots (optional)
Instead the function(s) fail with the following errors:
01:22:15.071: [onRequest] with Request ID=165
Run onRequest() func as normal (sync) mode
❌Error: ReferenceError: Can't find variable: __mapSwiftArrayToJSObject
01:22:15.227: [onResponse] with Request ID=165
Run onResponse() func as normal (sync) mode
❌Error: ReferenceError: Can't find variable: __mapSwiftArrayToJSObject
This happens for every script I've tried to create both in the public and Setapp versions of Proxyman.
If I change the functions to async, I do not get the error message, but the onRequest and/or onResponse functions don't appear to run.
@NghiaTranUIT commented on GitHub (Aug 31, 2022):
Thanks for the report @ddissett, but I could not reproduce it with a POST Request (JSON Both).
If you don't mind, what kind of your request?
I'd like to investigate it 👍
@ddissett commented on GitHub (Sep 19, 2022):
Hello, sorry for the delayed response. Here is some more information. I am able to reproduce the problem with just about any request. Therefore, here is a very simple example with a request against the web server running on my mac:
Here is the response headers:
I've attached a screenshot of the script and console output. Note: the first two items in the console (10:04:36) are from the displayed script but with
async functionrather thanfunctionon lines 1 and 6. I don't know if this is related, but note that the request and response objects logged in lines 2 and 7 are not in the log. In fact, I can't get anasync functionto do anything it seems. The next two log items (10:04:47) show the problem at hand (noasyncin front of the function def).@NghiaTranUIT commented on GitHub (Sep 20, 2022):
It seems that you're using very old macOS version, which is Intel Mac OS X 10_15_6.
I could not reproduce it on macOS 12.6, so it's guessed fixed. Please try this build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.10.0_Fix_scripting.dmg
I explicitly evaluate the
__mapSwiftArrayToJSObjectfunction, so it's always available.@ddissett commented on GitHub (Sep 21, 2022):
Yes. I am using an upgraded Mac Pro 4,1 and Mojave is the last version of MacOS supported on that hardware. I plan on inkling OpenCore so I can run unsupported versions, but that is a big project from what I understand.
will try in the version you posted. Thank you!
@ddissett commented on GitHub (Sep 21, 2022):
It still doesn't work with the version you posted and there's an additional error message now:
with
async function:with no
async:@ddissett commented on GitHub (Apr 4, 2025):
I suggest this be closed not planned stale. Its no longer relevant to me and probably no one else. Thanks.