Chrome, unlike every other browser I have used on these forums does not update the new/old status of items in the various sub-forums and search functions when you use the back function to return to the page. If I look for my posts, click on the first one that is marked new, read the posts, then hit back; the results page still shows what I had just read as unread. Firefox and others update the status as I expect.
To remedy this, I wrote a simple browser extension. Below are the files one needs. I am not ready to create a packed extension as yet, and I want to provide my source. To use these, you need to use the developer mode of Chromium to load unpacked extensions. See the Chromium Extension Developer docs.
manifest.json
{
"manifest_version": 2,
"name": "Arch Linux Forums Fixes",
"description": "This extension fixes weirdness in Arch Linux Forums.",
"version": "1.0",
"permissions": [
"https://bbs.archlinux.org/",
"tabs"
],
"background" : {
"scripts": ["background.js"]},
"page_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_scripts":
[
{
"matches":["https://bbs.archlinux.org/*"],
"js":["jquery-min.js","action.js"],
"run_at": "document_start"
}
]
}
action.js
var myclass = new RegExp('\\binew\\b');
var elem = document.getElementsByTagName('*');
// If there are any elements taged as inew, they may be stale. If one is found,
// refresh the part of the page that contains the results using Ajax
chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {
if (msg.action == 'check_for_reload') {
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes))
{
// jQuery load used this way was giving me duplicate tags. Unwrap the new one after we are done
$("#brdmain").load(location.href+" #brdmain", function () {
$(this).children().unwrap() });// remove the second brdmain from the DOM completely
// once we find one inew, no need to keep looking
break;
}
}
}
});
popup.html
<!doctype html>
<html>
<head>
<title>Arch Forums Hacks</title>
<style>
body {
min-width: 357px;
overflow-x: hidden;
}
img {
margin: 5px;
border: 2px solid black;
vertical-align: middle;
width: 75px;
height: 75px;
}
</style>
<!-- JavaScript and HTML must be in separate files -->
<script src="popup.js"></script>
</head>
<body>
<div id=fixme>This space intentially left blank></div>
</body>
popup.js
document.addEventListener('DOMContentLoaded', function () {
document.getElementById("fixme").innerHTML = "<u>Arch Linux Forus Hacks</u><p>Someday I'll do something useful in this space. Maybe controls for BBCode or something like that.<p>For now, I have focused on making the back button work as I expect.<p>>ewaller";
});
You also need an arch icon called icon.png, and jQuery (min) in a file called jQuery-min.js
Edit: Here is a link to a tar file https://dl.dropboxusercontent.com/u/103 … hForum.tar
It should be possible to unpack this, put chromium into developer mode, and install the extension by pointing chromium's unpacked extension search at the directory archForum