Is it possible to attach event on the *opening* of the context menu? - google-chrome-extension

I am developing a WebExtension and as you know it is impossible to inject content script on chrome://* pages and https://chrome.google.com/webstore/*. I have a buttons in a context menu and for correct UX I would like to drop my item from context menu on such protected page.
According to the documentation I can handle click on my context menu item, but looks like no way to check the url of the page on the moment of right mouse click without trying to inject content script into every page?
As a workaround I have a code that checks url after click to the menu item.

Related

Chrome Extension Context Menu Items Limit

Although the docs are pointing out:
The maximum number of items that can be added to the top-level browser action context menu is menus.ACTION_MENU_TOP_LEVEL_LIMIT, but you can add any number of items to submenus.
I am only able to add 1000 submenu items to the Chrome Extension context menu.
I don't want to create a UI additionally, because the context menu is really handy for my use case. The user is working in a code editor and can look up code syntax string values via the context menu and can add the value at the position of the cursor where the user right-clicked.
Do you know of such limitations or a workaround besides using an additional UI element?

Liferay 7.3: How to make menu items in a theme controlled by admin

I have a liferay theme for version 7.3. I am facing one problem in the theme's menu.
Now menu has some static items. How can I change (add / remove) items dynamically by admin account?
The menu is added in /src/templates/portal_normal.ftl as
<#include "${full_templates_path}/menu-bar.ftl" />
this file has static html data.
Now how can I make it dynamic so that admin can change the menu items?
Make the menu as a web content, and drag it to the theme? Not makes sense because menu is the part of the theme.
Or any other way of picking the menu items, looping the items in .ftl and display it?
The times of scripting navigation and menus in the theme are over, and I'd rather recommend to embed a portlet in your theme that does the job. That might be a stock NavigationMenu portlet (see how Liferay's default "classic theme" does this with NavigationMenu or the SearchBar), or a custom one, which generates exactly what you'd like.
Reason: It's a lot simpler to redeploy a new portlet and generate/test appropriate HTML markup generation in a portlet than it is to implement proper error handling in a theme's freemarker script.
The solution can be if you want to add your data in navigation menu in themes, go into the navigation menus inside site builder in menu and create a new menu by clicking + button on top right and name the menu. Then go into the pages inside site builder inside menu. There will be a + sign on public pages. Click that and add a page that you want to list. If you want to create a submenu then on the page that is created, create a subpage by clicking there + sign. The page will be child and will be shown as a sub menu in theme.

How to add menuitem or button on Netsuite

Recently I built suitelet script and I want to execute that script clicking menu item.
Let me know how to add menuitem.
Otherwise I want to add button to execute that script.
For instance I want to add button on list of items.
You could be on items list page by Lists/Websites/Items.
There are already Edit View button and New Item button, but I want to add my own button.
Thanks in advance.
You add a navigation item by going to your Suitelet's Script Deployment record and adding an entry in the Links tab.
You can not script very many of the List pages, if any of them, so you won't be able to add your button here. You are able to add buttons to the pages for a single Record.
If you add your Link to the main navigation, that would seem to accomplish what you want as that navigation is available on every page.

How to tell the context an Xpage is running in - Sidebar

I have an Xpage that I want to put in a panel in the sidebar.
I only want the entry part to be in the panel, so I made a ccEntry Custom Control and I put it into an Xpage for the main app and into an Xpage that is for the widget and ONLY contains the ccEntry form.
When I run the widget in the sidebar and hit submit, the code in the submit (which says previous) goes to the entire page. I want to put something in the button to like if I am in a sidebar then do this else do this. So if I could grab the name of the Xpage in a field that would do, but I cannot figure out how to do this.
Try view.getPageName(). That will give you a string of the current XPage's name in the format "/somepage.xsp".
#Jesse's solution makes something nasty: the control gets tightly coupled to its surroundings. You have two options:
Redirect
Define custom control's parameter with page name or URL to redirect to. Your submit button then redirects to that URL (accessed by compositeData.param). Your pages define different parameter value.
Navigation (preferred)
Your submit button's last command is simple line of code:
return "submitted";
Your pages for app/sidebar define different navigation rule target for the same rule: "submitted".

Extension-Specific Context Menu

I'm trying to add an item to the right-click menu on my extension. I've tried to find a method which would work, but a lot of the results seem to deal with context menus on the actual page, not the extension icon itself. The contextMenus API doesn't seem to work for this, unfortunately.
There is currently no API for that. Head for Chromium Issue 78631 and click the star to cast your vote for it and receive updates by e-mail. In the meantime, you could create a popup with a menu that lists both the primary action and the actions you would have put in the context menu.
(I assume you're trying to add the context menu item to your browser action. Your question is a little ambiguous.)

Resources