mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 22:08:00 +01:00
Fix #258: :set urlseparator= results in infinite loop
This commit is contained in:
@@ -173,24 +173,18 @@ const util = { //{{{
|
||||
* @param {string} str
|
||||
* @param {RegExp} marker
|
||||
*/
|
||||
/*
|
||||
* I hate this function. I hate it, I hate it. I really hate it.
|
||||
* --Kris
|
||||
*/
|
||||
splitLiteral: function splitLiteral(str, marker)
|
||||
{
|
||||
let re = RegExp(/((?:[^\\'"]|\\(?:%)|'.*?'|".*?")*?)(%|$)/.source.replace(/%/g, marker.source), "gy");
|
||||
let results = [];
|
||||
let resep = RegExp(/^(([^\\'"]|\\.|'([^\\']|\\.)*'|"([^\\"]|\\.)*")*?)/.source + marker.source);
|
||||
let cont = true;
|
||||
let match;
|
||||
|
||||
while (cont)
|
||||
{
|
||||
cont = false;
|
||||
str = str.replace(resep, function (match, before)
|
||||
{
|
||||
results.push(before);
|
||||
cont = true;
|
||||
return "";
|
||||
});
|
||||
}
|
||||
|
||||
results.push(str);
|
||||
while ((match = re.exec(str)) && match[0])
|
||||
results.push(match[1]);
|
||||
return results;
|
||||
},
|
||||
|
||||
|
||||
@@ -461,12 +461,16 @@ const config = { //{{{
|
||||
"Change the title of the window",
|
||||
"string", "Vimperator",
|
||||
{
|
||||
getter: function() {
|
||||
return document.getElementById(config.mainWindowID || "main-window")
|
||||
.getAttribute("titlemodifier");
|
||||
},
|
||||
setter: function (value)
|
||||
{
|
||||
try
|
||||
{
|
||||
let id = config.mainWindowID || "main-window";
|
||||
document.getElementById(id).setAttribute("titlemodifier", value);
|
||||
document.getElementById(config.mainWindowID || "main-window")
|
||||
.setAttribute("titlemodifier", value);
|
||||
if (window.content.document.title.length > 0)
|
||||
document.title = window.content.document.title + " - " + value;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user