Compare commits

...
18 Commits
Author SHA1 Message Date
matmoul e16698ad39 Version 0.1.25 2026-11-16 22:54:33 +01:00
MatMoul 01cb753277 Merge pull request #195 from xan2622/fix-back-button
Fix Back button not returning to the parent folder
2026-11-16 22:50:55 +01:00
xan2622 f32a72210c Fix Back button not returning to the parent folder
The Back link used href="#" with an onclick calling history.back()
without preventing the default action: the fragment navigation was
applied before the asynchronous history traversal, which then only went
back to the same folder URL without '#'.

The Back link now targets the parent folder, so it also works when the
folder was opened in a new tab (no usable history). On a plain click,
when the previous history entry is the parent folder (checked with the
Navigation API when available), it goes back in history instead, so no
extra entry is added and the parent page state is restored. If the
traversal fails, the direct link is used. Modified clicks keep the
default link behavior.

Grid cells now reset their link target with removeAttribute('target'):
'delete link.target' is a no-op on an HTMLAnchorElement, so a cell that
had held a bookmark opened in a new tab kept target="_blank" after
paging, and a folder later shown there opened in a new tab despite the
'open folder' setting.

The dial URL building is shared by folder and Back links through
utils.getDialUrl, removing an unreachable branch (dial.path is never
empty).
2026-11-12 20:09:33 +01:00
MatMoul b1f76dadde Merge pull request #193 from manner82/fix/issue-192-context-menus-sendmessage
Fix context menus on dial page for Firefox 152+ (replace deprecated tabs.executeScript)
2026-06-28 15:34:52 +02:00
Robert Manner 7dc29e5a70 Version 0.1.24 2026-06-25 09:25:59 +02:00
Robert Manner 3fd4cd6d3b js: replace deprecated tabs.executeScript with tabs.sendMessage
The dial-page context menus invoked window.dial.* functions via
browser.tabs.executeScript. That API is deprecated since Firefox 149 and
removed in Firefox 152, which broke creating/editing bookmarks and folders
from the dial page (issue #192).

Switch the menu handlers to browser.tabs.sendMessage. New menu command IDs
(200-207) are added to the Commands enum in both background.js and dial.js,
and the existing runtime.onMessage listener in dial.js now dispatches these
commands to the corresponding dial.* functions using the page-side
_selectedItem state.

Fixes #192
2026-06-24 12:42:21 +02:00
matmoul 42800d31c1 Version 0.1.23 2026-02-25 22:48:40 +01:00
matmoul 9cab257540 Fix iframe onload event positioning 2026-02-25 22:48:17 +01:00
matmoul 5a8e8bb745 Version 0.1.22 2026-02-25 18:45:42 +01:00
matmoul 8a54056392 fix:ESR compatibility 2026-02-25 18:45:05 +01:00
matmoul 20c106d5fa Version 0.1.21 2026-02-25 01:49:12 +01:00
matmoul 137bd470cf Fix: Replace 'dial' with 'dial.html' in URL paths and context menu patterns 2026-02-25 01:35:46 +01:00
matmoul a312b0b2d4 Rename dial to dial.html, update background.js to use dial.html URL, modify manifest.json to use dial.html for newtab and add data_collection_permissions 2026-02-25 01:07:47 +01:00
matmoul 806e134b52 Version 0.1.20 2021-01-30 15:12:34 +01:00
matmoul 633c5756a1 Patch Context Menu 2021-01-30 15:09:03 +01:00
MatMoul d2ea81d2ca Merge pull request #165 from tamiros/locale/hebrew
Locale/hebrew
2021-01-27 20:04:19 +01:00
Tamir 86f8063b11 missed one 2021-01-27 10:53:56 +02:00
Tamir 95a1ca420d added heberw translation 2021-01-27 10:46:09 +02:00
5 changed files with 257 additions and 23 deletions

No files matched your search

+67
View File
@@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "הוסף לחיוג מהיר",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "חדש",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "מועדף",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "הכנס קישור חדש למועדף :",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "תיקייה",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "הכנס שם חדש לתיקייה :",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "מאפיינים",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "רענן",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "צלם מסך כאן",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "צלם מסך בלשונית חדשה",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "מחק",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "האם למחוק $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "הגדרות חיוג מהיר",
"description": "Text of settings menu item."
}
}
View File
File renamed without changes.
+123 -9
View File
@@ -6,7 +6,7 @@ app.init = function(){ // Init module
browser.runtime.sendMessage({ cmd: app.Messages.Commands.settingsChanged });
browser.browserAction.onClicked.addListener(function(e){
if(app.settings.openQuickDialInNewPage) browser.tabs.create({});
else browser.tabs.update(e.id, {url: '/dial'}).then();
else browser.tabs.update(e.id, {url: '/dial.html'}).then();
});
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
app.ContextMenus.initMenu();
@@ -22,7 +22,7 @@ app.init = function(){ // Init module
browser.tabs.query({}).then( function(tabs) {
tabs.forEach(function(itm){
if(itm.url=='about:blank'){
browser.tabs.update(itm.id, {url: browser.extension.getURL('dial')});
browser.tabs.update(itm.id, {url: browser.runtime.getURL('dial.html')});
}
});
});
@@ -46,7 +46,15 @@ app.Messages.Commands = {
refreshNode: 9,
capturePage: 10,
settingsChanged: 100,
gridNodesLoaded: 101
gridNodesLoaded: 101,
menuCreateBookmark: 200,
menuCreateFolder: 201,
menuEditSettings: 202,
menuEditProperties: 203,
menuRefreshNode: 204,
menuCaptureHere: 205,
menuCapturePage: 206,
menuDeleteNode: 207
};
app.Messages.init = function(){ // Init Messages Listeners
browser.runtime.onMessage.addListener(function(request, sender, sendResponse){
@@ -276,15 +284,121 @@ app.ContextMenus.menuItemClicked = function(info, tab){
});
};
app.ContextMenus.initMenu = function(){ // (Called from app.init) Init context menu in all pages
// Create Add Context menu for all pages
if(app.settings.menuShowAdd){
browser.contextMenus.create({ // Create Context menu
browser.contextMenus.create({
id: 'AddToQuickDial',
title: browser.i18n.getMessage("menuAddToQuickDial"),
contexts: ["all"],
documentUrlPatterns: [ 'http://*/*', 'https://*/*', 'file://*/*', 'ftp://*/*' ]
}, function(){});
browser.contextMenus.onClicked.addListener(app.ContextMenus.menuItemClicked);
documentUrlPatterns: [ 'http://*/*', 'https://*/*', 'file://*/*', 'ftp://*/*' ],
onclick(info, tab) { app.ContextMenus.menuItemClicked(info, tab) }
});
}
// Create WebExt Page Context menu
browser.contextMenus.create({
id: "pagemenu",
title: "Quick Dial",
documentUrlPatterns: [ 'moz-extension://*/dial.html', 'moz-extension://*/dial.html?*' ],
contexts: ["page"]
});
browser.contextMenus.create({
id: "pagemenunew",
parentId: "pagemenu",
title: browser.i18n.getMessage("menuNew")
});
browser.contextMenus.create({
parentId: "pagemenunew",
title: browser.i18n.getMessage("menuNewBookmark"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateBookmark });
}
});
browser.contextMenus.create({
parentId: "pagemenunew",
title: browser.i18n.getMessage("menuNewFolder"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateFolder });
}
});
browser.contextMenus.create({ parentId: "pagemenu", type: "separator" });
browser.contextMenus.create({
parentId: "pagemenu",
title: browser.i18n.getMessage("menuSettings"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuEditSettings });
}
});
// Create WebExt Link Context menu
browser.contextMenus.create({
id: "itemmenu",
title: "Quick Dial",
documentUrlPatterns: [ 'moz-extension://*/dial.html', 'moz-extension://*/dial.html?*' ],
contexts: ["link"]
});
browser.contextMenus.create({
id: "itemmenunew",
parentId: "itemmenu",
title: browser.i18n.getMessage("menuNew")
});
browser.contextMenus.create({
parentId: "itemmenunew",
title: browser.i18n.getMessage("menuNewBookmark"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateBookmark });
}
});
browser.contextMenus.create({
parentId: "itemmenunew",
title: browser.i18n.getMessage("menuNewFolder"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateFolder });
}
});
browser.contextMenus.create({ parentId: "itemmenu", type: "separator" });
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuProperties"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuEditProperties });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuRefreshItem"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuRefreshNode });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuCaptureHere"),
visible: false,
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCaptureHere });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuCapturePage"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCapturePage });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuDeleteItem"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuDeleteNode });
}
});
browser.contextMenus.create({ parentId: "itemmenu", type: "separator" });
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuSettings"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuEditSettings });
}
});
};
app.ContextMenus.updateMenu = function(){
browser.contextMenus.onClicked.removeListener(app.ContextMenus.menuItemClicked);
@@ -435,8 +549,8 @@ app.SiteInfos.fromFrame = function(url, callback){ // Retrieve infos from an ifr
iframe.style.position = 'absolute';
iframe.scrolling = 'no';
var content = xmlHttp.responseText.replace('<head>', '<head><base href="' + url + '">');
iframe.onload = function(){ pageLoaded(); }
document.body.appendChild(iframe);
iframe.onload = function(){ pageLoaded(); }
iframe.srcdoc = content;
setTimeout(function(){ pageLoaded(); }, 6000);
}
@@ -758,7 +872,7 @@ app.GridNodes.capturePage = function(gridNode, callback){
if(nodes){
var path = '';
for(var i=1; i<nodes.length; i++) path = path + '/' + nodes[i].title;
app.SiteInfos.fromNewTab('/dial?path=' + path, function(infos){
app.SiteInfos.fromNewTab('/dial.html?path=' + path, function(infos){
if(infos){
gridNode.image = infos.screenshot;
} else {
+60 -10
View File
@@ -60,6 +60,11 @@ utils.getPath = function(){
if(path) return path + '/';
else return '/';
};
utils.getDialUrl = function(path){
var url = '?bg=' + encodeURIComponent(app.settings.backgroundColor);
if(path) url += '&path=' + encodeURIComponent(path);
return url;
};
app.init = function(){
app.Messages.getSettings(function(settings){
@@ -84,7 +89,15 @@ app.Messages.Commands = {
refreshNode: 9,
capturePage: 10,
settingsChanged: 100,
gridNodesLoaded: 101
gridNodesLoaded: 101,
menuCreateBookmark: 200,
menuCreateFolder: 201,
menuEditSettings: 202,
menuEditProperties: 203,
menuRefreshNode: 204,
menuCaptureHere: 205,
menuCapturePage: 206,
menuDeleteNode: 207
};
app.Messages.init = function(){
browser.runtime.onMessage.addListener(function(request, sender, sendResponse){
@@ -95,6 +108,30 @@ app.Messages.init = function(){
case app.Messages.Commands.gridNodesLoaded:
if(dial.skipUpdate!=true) app.Messages.getNode(dial.path, app.GridNodes._changed);
break;
case app.Messages.Commands.menuCreateBookmark:
dial.createBookmark();
break;
case app.Messages.Commands.menuCreateFolder:
dial.createFolder();
break;
case app.Messages.Commands.menuEditSettings:
dial.editSettings();
break;
case app.Messages.Commands.menuEditProperties:
dial.editProperties(dial._selectedItem);
break;
case app.Messages.Commands.menuRefreshNode:
dial.refreshNode(dial._selectedItem);
break;
case app.Messages.Commands.menuCaptureHere:
dial.captureHere(dial._selectedItem);
break;
case app.Messages.Commands.menuCapturePage:
dial.capturePage(dial._selectedItem);
break;
case app.Messages.Commands.menuDeleteNode:
dial.deleteNode();
break;
}
});
};
@@ -163,10 +200,11 @@ app.GridNodes._changed = function(node){
dial.init = function(){
dial.initMenus();
//dial.initMenus();
dial.Title = document.createElement('title');
document.head.appendChild(dial.Title);
};
/*
dial.initMenus = function(){
document.body.setAttribute('contextmenu', 'page');
dial.PageMenu = document.createElement('menu');
@@ -250,6 +288,7 @@ dial.initMenus = function(){
dial.ItemMenu.appendChild(dial.ItemMenuSettings);
document.body.appendChild(dial.ItemMenu);
}
*/
dial.initStyles = function(){
function applyImageMode(imageMode, target){
switch(imageMode){
@@ -328,6 +367,7 @@ dial.initGrid = function(){
link.appendChild(document.createElement('div'));
link.onmousedown = function(){
dial._selectedItem = this;
/*
if(dial._selectedItem.Node){
switch(dial._selectedItem.Node.type){
case app.GridNodes.GridNodeType.folder:
@@ -339,6 +379,7 @@ dial.initGrid = function(){
break;
}
}
*/
};
function dragstart_handler(ev) {
@@ -481,7 +522,7 @@ dial.populateGrid = function(){
link.Node = null;
link.className = 'Empty';
link.childNodes[0].style.backgroundImage = '';
if(link.target) delete link.target;
link.removeAttribute('target');
link.href = null;
link.onclick = null;
link.removeAttribute('contextmenu');
@@ -491,9 +532,19 @@ dial.populateGrid = function(){
link.className = 'Back';
link.childNodes[0].style.backgroundImage = '';
link.childNodes[1].innerText = 'Back';
if(link.target) delete link.target;
link.href = '#';
link.onclick = function(){ window.history.back(); }
link.removeAttribute('target');
var parentPath = dial.path.substring(0, dial.path.lastIndexOf('/', dial.path.length - 2));
link.href = utils.getDialUrl(parentPath);
link.onclick = function(e){
if(e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) return;
if(!window.navigation || !navigation.canGoBack) return;
var previousUrl = navigation.entries()[navigation.currentEntry.index - 1].url;
if(!previousUrl) return;
previousUrl = new URL(previousUrl);
if(previousUrl.pathname != location.pathname || (previousUrl.searchParams.get('path') || '') != parentPath) return;
e.preventDefault();
navigation.back().committed.catch(function(){ location.assign(link.href); });
};
link.removeAttribute('contextmenu');
}
populateFolder = function(link, node){
@@ -508,14 +559,13 @@ dial.populateGrid = function(){
link.childNodes[1].innerText = node.title;
switch(app.settings.grid.openFolderMethod){
case 0:
if(link.target) delete link.target;
link.removeAttribute('target');
break;
case 1:
link.target = '_blank';
break;
}
if(dial.path) link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(dial.path + node.title);
else link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(node.title);
link.href = utils.getDialUrl(dial.path + node.title);
link.onclick = null;
link.setAttribute('contextmenu', 'item');
}
@@ -535,7 +585,7 @@ dial.populateGrid = function(){
link.childNodes[1].innerText = node.title;
switch(app.settings.grid.openBookmarkMethod){
case 0:
if(link.target) delete link.target;
link.removeAttribute('target');
break;
case 1:
link.target = '_blank';
+7 -4
View File
@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Quick Dial",
"version": "0.1.19",
"version": "0.1.25",
"author": "MatMoul",
"homepage_url": "https://github.com/MatMoul/quickdial-webext",
"developer": {
@@ -37,13 +37,16 @@
},
"chrome_url_overrides" : {
"newtab": "dial"
"newtab": "dial.html"
},
"applications": {
"browser_specific_settings": {
"gecko": {
"id": "quickdial@matmoul.com",
"strict_min_version": "52.0"
"strict_min_version": "140.0",
"data_collection_permissions": {
"required": ["none"]
}
}
},