Skip to content

JS rewriting abusively rewrite import function #255

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

Closed
benoit74 opened this issue Apr 10, 2025 · 0 comments · Fixed by #259
Closed

JS rewriting abusively rewrite import function #255

benoit74 opened this issue Apr 10, 2025 · 0 comments · Fixed by #259
Assignees
Labels
bug Something isn't working
Milestone

Comments

@benoit74
Copy link
Collaborator

import(e) function call is abusively rewritten into ____wb_rewrite_import__("", e) instead of being kept as-is.

Found on https://activistchecklist.org/_next/static/chunks/main-151d36022e25d4e8.js

          export() {
            return {
              numItems: this.numItems,
              errorRate: this.errorRate,
              numBits: this.numBits,
              numHashes: this.numHashes,
              bitArray: this.bitArray,
            };
          }
          import(e) {
            (this.numItems = e.numItems),
              (this.errorRate = e.errorRate),
              (this.numBits = e.numBits),
              (this.numHashes = e.numHashes),
              (this.bitArray = e.bitArray);
          }
          add(e) {
            this.getHashValues(e).forEach((e) => {
              this.bitArray[e] = 1;
            });
          }

This is an issue for zimit / warc2zim only for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant