Skip to content

Commit

Permalink
Fix #193
Browse files Browse the repository at this point in the history
  • Loading branch information
joelthorner committed Sep 13, 2019
1 parent da4cf6b commit 72e3061
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
31 changes: 12 additions & 19 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,11 @@ chrome.runtime.onInstalled.addListener(function (details) {

// TicketConsume system
function openTicketConsumeTab() {
chrome.tabs.query({
url: '*://zdreports/rtm.cfm?TicketConsume=true'
// url: '*://joelthorner.github.io/temp/?TicketConsume=true'
}, function (tabs) {
if (!tabs.length) {
chrome.tabs.create({
url: 'http://192.168.110.109:12853/zdreports/rtm.cfm?TicketConsume=true',
// url: 'https://joelthorner.github.io/temp/?TicketConsume=true',
active: false,
pinned: true,
});
} else {
tabs.forEach(tab => {
chrome.tabs.reload(tab.id);
});
}
chrome.windows.create({
url: 'http://192.168.110.109:12853/zdreports/rtm.cfm?TicketConsume=true',
// url: 'https://joelthorner.github.io/temp/?TicketConsume=true',
state: 'minimized'
});

}
chrome.runtime.onMessage.addListener(function (message, sender) {
if (message.name == 'openTicketConsumeTab') {
Expand All @@ -118,12 +105,18 @@ chrome.runtime.onMessage.addListener(function (message, sender) {
chrome.tabs.query({ url: '*://tlgcommercehelp.zendesk.com/*' }, function (tabs) {
tabs.forEach(tab => {
chrome.tabs.sendMessage(tab.id, { data: message.data });
chrome.tabs.query({
url: 'http://192.168.110.109:12853/zdreports/rtm.cfm?TicketConsume=true'
// url: '*://joelthorner.github.io/temp/?TicketConsume=true'
}, function (tabs) {
tabs.forEach(tab => { chrome.tabs.remove(tab.id) });
});
});
});
}
});
chrome.tabs.onActivated.addListener(function (activeInfo) {
chrome.tabs.get(activeInfo.tabId, function (tab){
chrome.tabs.get(activeInfo.tabId, function (tab) {
if (tab.url.includes("tlgcommercehelp.zendesk.com")) {
chrome.storage.sync.get({ optZenTicketConsume: false }, function (result) {
if (result.optZenTicketConsume) {
Expand All @@ -132,4 +125,4 @@ chrome.tabs.onActivated.addListener(function (activeInfo) {
});
}
});
});
});
3 changes: 2 additions & 1 deletion js/options/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const CHANGELOG = [
{
version: 'v2.3.16', date: '13 Sep 2019',
lines: [
'CHANGED Limitation of new version notify, only major and medium version change #194'
'CHANGED Limitation of new version notify, only major and medium version change #194',
'FIXED Fix url close match tab ticketConsume #193'
]
}, {
version: 'v2.3.15', date: '10 Sep 2019',
Expand Down

0 comments on commit 72e3061

Please sign in to comment.