Fix #3145: urlincrement binds accept prefixes

This commit is contained in:
Oliver Blanthorn 2020-12-31 13:29:31 +01:00
parent 7b4b59cfa1
commit cec3066178
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -1607,10 +1607,12 @@ export function followpage(rel: "next" | "prev" = "next") {
/** Increment the current tab URL
*
* @param count the increment step, can be positive or negative
*
* @param multiplier multiplies the count so that e.g. `5<C-x>` works.
*/
//#content
export function urlincrement(count = 1) {
const newUrl = UrlUtil.incrementUrl(window.location.href, count)
export function urlincrement(count = 1, multiplier = 1) {
const newUrl = UrlUtil.incrementUrl(window.location.href, count * multiplier)
if (newUrl !== null) {
// This might throw an error when using incrementurl on a moz-extension:// page if the page we're trying to access doesn't exist