0

I have a bookmark in my Firefox like this:

http://foo.bar/index.html?year=2017&month=7&day=21&group=11,21,31&type=something

My question is whether it's possible to dynamically assign year, month and day in such bookmarked URL? I don't want to change year, month and day every time it has changed. Is there a way to replace it with something like

http://foo.bar/index.html?year=getcurrentyear()&month=getcurrentmonth()

Or something like that?

1 Answers1

1
  1. You can set a single parameter in the bookmarked url manually from the address bar. You have to bookmark your url, set short name for it and replace the part of the url you would like to set dynamically with %s, i.e. https://translate.yandex.ru/?lang=en-ru&text=%s. After that you may type url-short-name some-text in the address bar and open the translation page for some-text.

  2. A more complex solution is to create a bookmarklet like this javascript:(function(){d=new Date();location.href="https://foo.bar/?year="+d.getFullYear()+"&month="+d.getMonth()})(); To add this to your bookmarks, you need to bookmark any page and than replace its address with javascript code. I suppose if you are good at Javascript you may come with more elegant code for your bookmark.

You can find more about bookmarklets in this question.

skoval00
  • 629
  • 5
  • 7