Skip to content

Commit 2a6eeeb

Browse files
authored
Remove noProxy option from -sPROXY_TO_WORKER (#23297)
The `noProxy` options was added back in 2014 in c2295c7, but doesn't have any test coverage. This means there is is good chance its already broken. What is more it a fair mount of complexity since it adds an additional way in which certain JS files get pre-processed and included. I propose that we simply remove it, but and alternative would be to fine a way to test it. I'm not quite sure who the end user of this feature might be though.
1 parent 07e4fb2 commit 2a6eeeb

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ See docs/process.md for more on how version tagging works.
7878
when linking in debug mode (`-O0` and/or `-sASSERTIONS`). This means that
7979
things like double-free will be detected in these builds. Previously this was
8080
only true with `-sASSERTIONS=2`. (#23330)
81+
- The code geneated in `--proxy-to-worker` no longer contains support for
82+
reading the `?noProxy` URL parameter (this was not documented or tested).
83+
(#23297)
8184

8285
3.1.74 - 12/14/24
8386
-----------------

tools/link.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,30 +2571,7 @@ def generate_traditional_runtime_html(target, options, js_target, target_basenam
25712571

25722572
if settings.PROXY_TO_WORKER:
25732573
proxy_worker_filename = (settings.PROXY_TO_WORKER_FILENAME or target_basename) + '.js'
2574-
worker_js = worker_js_script(proxy_worker_filename)
2575-
script.inline = ('''
2576-
var filename = '%s';
2577-
if ((',' + window.location.search.substr(1) + ',').indexOf(',noProxy,') < 0) {
2578-
console.log('running code in a web worker');
2579-
''' % get_subresource_location_js(proxy_worker_filename)) + worker_js + '''
2580-
} else {
2581-
console.log('running code on the main thread');
2582-
var fileBytes = tryParseAsDataURI(filename);
2583-
var script = document.createElement('script');
2584-
if (fileBytes) {
2585-
script.innerHTML = intArrayToString(fileBytes);
2586-
} else {
2587-
script.src = filename;
2588-
}
2589-
document.body.appendChild(script);
2590-
}
2591-
'''
2592-
# add required helper functions such as tryParseAsDataURI
2593-
for filename in ('arrayUtils.js', 'base64Decode.js', 'URIUtils.js'):
2594-
content = shared.read_and_preprocess(utils.path_from_root('src', filename))
2595-
script.inline = content + script.inline
2596-
2597-
script.inline = 'var ASSERTIONS = %s;\n%s' % (settings.ASSERTIONS, script.inline)
2574+
script.inline = worker_js_script(proxy_worker_filename)
25982575
else:
25992576
# Normal code generation path
26002577
script.src = base_js_target

0 commit comments

Comments
 (0)