Skip to content

Instantly share code, notes, and snippets.

@Chocimier
Created April 10, 2018 20:18
Show Gist options
  • Save Chocimier/5f3de74ba504eb900c288a9abb68a923 to your computer and use it in GitHub Desktop.
Save Chocimier/5f3de74ba504eb900c288a9abb68a923 to your computer and use it in GitHub Desktop.
modes.add_cmds({{ ":ddg", "Search with DuckDuckGo",
function (w, o) w.view:eval_js("(function(){ var form = document.createElement('form'); form.method='POST'; form.action='https://duckduckgo.com'; var input=document.createElement('input'); input.name='q'; input.value='".. o.arg .. "'; form.appendChild(input); form.submit(); })();", {
no_return = true,
callback = function (_, err)
w:error(err)
end,
}) end }})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment