5252541fe3
Previously calling `script.code()` would fail if the script didn't have a `name`. This wasn't being hit in practice because the only place that constructs GreasemonkeyScripts was checking for that condition and add the filename there as a fallback. This change make the `name` attribute more explicitly mandatory by failing with a `ValueError` if it is not provided and make it still possible to use the filename fallback in that case by adding a `filename` keyward argument to `__init__()`. Additionally where `script_meta` is used in `script.code()` a fallback to and emptry string was added so it doesn't fail for raw javascript files without greasemonkey metadata. |
||
---|---|---|
.. | ||
position_caret | ||
stylesheet | ||
base.html | ||
conftest.py | ||
test_greasemonkey.py | ||
test_js_execution.py |