https://stackoverflow.com/unanswered/tagged/apache-spark?page=101&tab=noanswers
The last page could change, e.g. 102, 101. How to ensure that the last page is always opened?
https://stackoverflow.com/unanswered/tagged/apache-spark?page=101&tab=noanswers
The last page could change, e.g. 102, 101. How to ensure that the last page is always opened?
There is no built-in functionality to do that.
I have created this userscript that achieves what you want by navigating (and then bookmark it for example) to the page -1.
Here is the script that happily runs with GreaseMonkey or TamperMonkey:
// ==UserScript==
// @name go to last page
// @namespace https://stackoverflow.com/users/578411/rene
// @include *//stackoverflow.com/unanswered/tagged/*?page=-1&tab=noanswers
// @version 1
// @grant none
// ==/UserScript==
/*global $, console */
(function () {
'use strict';
// no regex, no glory
var regex = /.*\/unanswered\/tagged\/((.*)\?).*/g,
matches;
// find the tagname
if (((matches = regex.exec(document.location.toString())) !== null) && (matches.length === 3)) {
// fetch first page
$.get('/unanswered/tagged/' + matches[2] + '?page=1&pagesize=50&tab=noanswers', function (data) {
var prev, last;
// find the last page in the pager
$(data).find('div.pager > a').each(function () {
prev = last;
last = this;
});
// I assumed here that there are always more than
// 3 pages in the pager
if (prev) {
// navigate to the last page
document.location = prev.href;
}
});
}
}());
After you installed it, the script does its job if you visit:
https://stackoverflow.com/unanswered/tagged/haskell?page=-1&tab=noanswers
notice the page=-1
. Without the userscript you'll get an empty page. But as the userscript is only configured to run on this page it will starts its parsing and redirecting but won't interfere with other pages.