Under --automation-read-root, a document that links a JavaScript file
outside the read roots could still be written by a confined caller to
any output that carries the native document, and that document holds
the stored path. SVG and SVGZ output was already refused. This change
applies the same control to every output that carries the native
document, and they now return the same error, "a linked JavaScript file
is outside the read roots", without the path:
- document.serialize, document.export, document.exportSelection and
document.exportEps for vectorcraft, template, EPS, .ai and .ait files
(not a legacy version 7 .ai file, a .ai file of some of the
artboards, or one of the art's bounds)
- PDF with Preserve Editing on, as its preset, standard and options
leave it, when it holds every artboard, including document.exportPdf
- document.save, file.saveAs and file.saveAsTemplate
- document.exportForScreens and assets.export, checked with the
artboards each file is written with
- file.exportAs in the app
- file.package, before the folder is made, including when a linked
native document, or the native document a linked PDF, .ai or EPS
file carries, links such a file
Outputs that do not carry the native document, unconfined callers and
linked files inside the read roots are written as before.
An SVG or SVGZ writes each linked JavaScript file of SVG Interactivity
into a <script xlink:href> element as stored, so a caller with
automation read roots could read a path outside them from the exported
text. With read roots in force, an SVG or SVGZ of a document that links
such a file is now refused with "a linked JavaScript file is outside the
read roots", an error that names no file or folder. No file or folder is
written, and the document keeps the link.
- The check uses the rule document.json already applies to
svg_scripts: a relative path is taken from the document's folder, a
file: URL is a file, and another URL is not checked.
- It covers document.serialize, document.export, document.exportSelection,
document.exportForScreens and assets.export (before the folder is made
or any row is written), the SVG and SVGZ saves (also a save without a
path of a document saved as SVG), file.exportAs and the SVG Options
dialog's Show Code.
- Callers without roots, and the person at the keyboard, export the
links as stored.
Docs: docs/mcp.md, docs/target-app-parity.md.
With automation read roots in force, svgInteractivity.info and the files
reply of addFile and removeFile returned every linked JavaScript file as
stored, including paths outside the roots. They now name such a file by
its file name alone, as document.json does; a file inside the roots and
a URL are named as they are, and the document keeps every path.
removeFile also unlinks a file outside the roots by that file name. When
the name fits more than one linked file, it returns an error that names
no stored path and unlinks nothing. addFile still treats only the same
text as already linked.
In a frame a request drives, the JavaScript Files dialog lists such a
file by its file name while its selection keeps the file as linked, and
ui.inspect gives the selected file the same way. The person's frames
show full paths.