vimium-c icon indicating copy to clipboard operation
vimium-c copied to clipboard

javascript doesn't work on vimium://urls

Open Galliver7 opened this issue 11 months ago • 1 comments

Describe the bug

javascript had been ignore when it launch by vimium://urls via Custom search engines.

To Reproduce

  1. Go to Vimium C options > Custom Search Engines
  2. Add following search engines:
g: https://www.google.com/search?q=%s Google
dd: https://duckduckgo.com/?q=%s&t=h_ DuckDuckGo
# make new page with title which you defined.
newpage: javascript:(function(){\
var\ newWindow=window.open();\
var\ title='%S';\
var\ content='<html><head><title>'+title+'</title></head><body><h1>'+title+'</h1></body></html>';\
newWindow.document.write(content);\
newWindow.document.close();\
})(); new page with title

tests: vimium://urls/g|dd|newpage:%S for test
  1. Use the custom search engine, then newpage will ignore.

Browser, OS and Vimium C versions

  • Browser name: firefox
  • Browser version: 133.0.3 (aarch64)
  • Vimium C version: 1.99.997
  • OS name and version: Mac OS

I love this extention btw❤️ Thank you!

Galliver7 avatar Jan 13 '25 23:01 Galliver7

Um the problem does exist - neither the vimium://urls URL command nor the openUrl urls=[...] mapping can run javascript: URLs.

This is a known limitation which is designed to simplify Vimium C's code and behaviors.

I'll fix a bug about vimium://urls in days, and then it should support embedded vimium://run well:

ba: https://www.baidu.com/s?ie=utf-8&wd=%s
bi: https://www.bing.com/search?q=$s
np: vimium://run/openUrl#keyword=bi&reuse=newtab&#url=$s
tests: vimium://urls/ba|np:%S for test

Then you may take a try to open javascript: ... inside a second vimium://run/<special_command>

gdh1995 avatar Mar 31 '25 03:03 gdh1995