D
D
denn2020-09-30 14:57:59
Mozilla Firefox
denn, 2020-09-30 14:57:59

How to substitute url in firefox bookmark button?

There is a tab bar in firefox, and I want to add a button with a link https://developers.google.com/speed/pagespeed/insi... url_address_of_active_tab - how to substitute the url of the active tab here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-09-30
@iDx

When adding a bookmark, specify the following code instead of a link (the "Address" field):

javascript:(function(){
  let link = 'https://developers.google.com/speed/pagespeed/insights/?url=' + encodeURIComponent(window.location.href);
  Object.assign(document.createElement('a'), { target: '_blank', href: link}).click();
})()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question