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:
Florian Bruhin 2016-08-18 15:57:17 +02:00
parent 1956480164
commit 4345d60ff1
2 changed files with 2 additions and 3 deletions

View File

@ -64,8 +64,8 @@ def _convert_js_arg(arg):
def assemble(module, function, *args):
"""Assemble a javascript file and a function call."""
js_args = ', '.join(_convert_js_arg(arg) for arg in args)
if module in ['window', 'document']:
parts = [module, function]
if module == 'window':
parts = ['window', function]
else:
parts = ['window', '_qutebrowser', module, function]
code = '"use strict";\n{}({});'.format('.'.join(parts), js_args)

View File

@ -142,7 +142,6 @@ def test_convert_js_arg(arg, expected):
@pytest.mark.parametrize('base, expected_base', [
('window', 'window'),
('document', 'document'),
('foo', 'window._qutebrowser.foo'),
])
def test_assemble(base, expected_base):