I'm annoyed by our Ticketing System that always loads in the wrong view.
I wanted to fix this with a simple chrome extension that appends the required parameters to the ticket URL...
I found this solution:
Chrome Extension to Redirect to URL with Parameter
I can't get it working.. I imported the Extension (I see the Icon in Chrome) (I had a view issues with importing the manifest as my URL Permission weren't clear) Extension on the page looks like this:
But the Icon in the Top-Right is greyed out - maybe that's normal?
My Mainfest looks like this:
{
"manifest_version": 2,
"name": "OTRS Fixer",
"version": "0.1",
"description": "Fixes OTRS View",
"background": {
"scripts": ["background.js"]
},
"page_action": {
"default_icon": "icon.png"
},
"permissions": [
"tabs",
"webRequest",
"http://ticket.domain.com/otrs/*",
"webRequestBlocking"
]
}
My background.js file looks like this:
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
return {
redirectUrl: details.url + ";ZoomExpand=1"
};
},
{urls: ['http://ticket.infotrust.ch/otrs/*"'], types: ['main_frame']},
['blocking']
);
An example URL that would need to be changed:
http://ticket.domain.com/otrs/index.pl?Action=AgentTicketZoom;TicketID=85377
Is there any way to check if my script gets executed? (Like can I add a pop-up message or something?)
I'm aware that my current script would just add it to the end, no matter what exact URL it is (and therefore break the website, but I just want to see it in action, the logic shouldn't be the problem)
Any help appreciated, it's my very first Extension (after the tutorials of course)
EDIT:
The "maybe" greyed out icon: