Revert "javascript.assemble: Support document module"
This reverts commit afc7faabda
.
This isn't actually needed as we can't use document.getElementById()
directly without serializing anyways.
This commit is contained in:
parent
1956480164
commit
4345d60ff1
@ -64,8 +64,8 @@ def _convert_js_arg(arg):
|
|||||||
def assemble(module, function, *args):
|
def assemble(module, function, *args):
|
||||||
"""Assemble a javascript file and a function call."""
|
"""Assemble a javascript file and a function call."""
|
||||||
js_args = ', '.join(_convert_js_arg(arg) for arg in args)
|
js_args = ', '.join(_convert_js_arg(arg) for arg in args)
|
||||||
if module in ['window', 'document']:
|
if module == 'window':
|
||||||
parts = [module, function]
|
parts = ['window', function]
|
||||||
else:
|
else:
|
||||||
parts = ['window', '_qutebrowser', module, function]
|
parts = ['window', '_qutebrowser', module, function]
|
||||||
code = '"use strict";\n{}({});'.format('.'.join(parts), js_args)
|
code = '"use strict";\n{}({});'.format('.'.join(parts), js_args)
|
||||||
|
@ -142,7 +142,6 @@ def test_convert_js_arg(arg, expected):
|
|||||||
|
|
||||||
@pytest.mark.parametrize('base, expected_base', [
|
@pytest.mark.parametrize('base, expected_base', [
|
||||||
('window', 'window'),
|
('window', 'window'),
|
||||||
('document', 'document'),
|
|
||||||
('foo', 'window._qutebrowser.foo'),
|
('foo', 'window._qutebrowser.foo'),
|
||||||
])
|
])
|
||||||
def test_assemble(base, expected_base):
|
def test_assemble(base, expected_base):
|
||||||
|
Loading…
Reference in New Issue
Block a user