Gosh… this was (for me) so much easier with SDK. The extension worked well without having to worry about different frames, code injection and all that.
So let me try to understand this…
A html page can have multiple frames… Top and child frames.
The shortcut and its selection works on a regular html page because it doesn’t have child frames… there is just a top frame!?
However, on my icinga page there are child frames, so making the selection on the same frame (the top frame?) would return an empty string because the actual selection is on a child frame?
How can I access those child frames?
I read that content scripts can be injected into all frames using something like:
"content_scripts": [
{
"js": ["my-script.js"],
"matches": ["https://example.org/"],
"match_about_blank": true,
"all_frames": true
}
]
My extension consist of a manifest.json and a background script icinga_addon.js.
{
"manifest_version": 2,
"name": "Inc Icinga Shortcuts",
"version": "1.0",
"description": "Icinga Shortcuts",
"permissions": ["contextMenus","activeTab"],
"commands": {
"1 Host Connect": {
"suggested_key": {"default": "Alt+1" } ,
"description": "1 Host Connect"
}
},
"background": {
"scripts": ["icinga_addon.js"]
}
}
How could I implement this?
Many thanks in advance… really appreciate it!!