I am trying to grab the uuid that is assigned to each extenstion/add-on installation. This is not the extension ID that is that same across all extension installations. This is the one that is unique for each user per install.
you can call browser.runtime.getURL('/'); this will return you a url string like moz-extension://9a08sd798-af1b-4572-95ab-9d6866517ade/ then you can parse the string from that or if you need it to open a tab to your popup just put the url to your popup.
let url = browser.runtime.getURL('/dist/frontend/index.html');
browser.tabs.create({
url
})
Related
I am setting up an extension that prefills a Google form and adds the current URL into one of the fields in the form. However, the issue is that the extension isn't able to detect the complete URL. It only detects www.xyz.com/home.html while the complete URL includes a location hash(www.xyz.com/home.html#e12345678) which is very important and will need to be added to the form. Any ideas on how I can set this up?
I use the following code:
var url = tabs[0].url;
var furl = "https://docs.google.com/forms/xyz/viewform?entry.123="+url;
window.open(furl);
I've been tasked with creating a new column in the list of files in a Liferay 6.2 document library. For each file, that column should display a link with the text "Details" and the URL for that file's metadata page. In view_entries.jsp, I'm looking to add this field to a ResultRow. All I've been able to find so far, is DLUtil's getPreviewURL, which only seems to give me the URL for downloading the file itself, rather than leading to the metadata page. The Title column uses a TextSearchEntry, which ends up displaying with the URL I want, but I can't figure out how to either get that URL from it or change the text it displays the link with.
PortletURL rowURL = liferayPortletResponse.createRenderURL();
rowURL.setParameter("struts_action", "/document_library/view_file_entry");
rowURL.setParameter("redirect", HttpUtil.removeParameter(currentURL, liferayPortletResponse.getNamespace() + "ajax"));
rowURL.setParameter("fileEntryId", String.valueOf(fileEntry.getFileEntryId()));
In this code, fileEntry is the current document. To get the URL to the preview page, it's just rowURL.toString().
I have a site which shows a teaser (image+text) on all pages.
This should be editable from admin, so I created a small backend module (a simple form) where the admin should set the image and the text and save them in Typo3's registry db table:
This is how I save the text:
$request = $this->controllerContext->getRequest();
$arguments = $request->getArguments();
$registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( 't3lib_Registry' );
$extKey = $request->getControllerExtensionKey();
$registry->set( $extKey, 'text', $arguments['settings']['text'] );
but I don't know how to add an "Add image" link to display the file browser and get the url/id of the selected file.
Any ideas?
Thanks.
In order to have a file picker you will need to have a TCA for a FAL field. A TCA is usually connected to a table and I wouldn't know of any implementation with the registry as a "storage backend".
This means you would have to create TCEForms yourself and then intercept the saving process. This is possible but rarely used and rather complicated, see an example here:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/TYPO3_4-5:/typo3/sysext/version/ws/workspaceforms.php
(for TYPO3 4.x, for 6.x the class names have to be adjusted)
So I would suggest that you extend the table pages with a field for text and a FAL field instead of trying to write an own backend module for this purpose.
With this code I create a page in a Google site:
pageEntry = new WebPageEntry();
pageEntry.setTitle(new PlainTextConstruct(PageTitle));
..
..
client.insert(new URL(getContentFeedUrl()), pageEntry);
If the PageTitle contains something like "création" the page will created with the name https://sites.google.com/.../.../cration. So "création" is changed to "cration".
Is the process to change the page name available in the API? I would like to fetch the page by its path, but the only key I have is "création".
Maybe a better solution would be to strip the diacritics from the characters in the string before setting it as a page title? For instance, see the javascript function here. Then you page would be created with the URL /creation, which could be more desireable.
I am using CodedUI to automate my site .How will i get the current url .
i am launching http://example.com ,but later in my application i am appending E=U and E=P to it bases on some conditions .I want to know how to identify if E=U /E=p ?
I think this should work:
BrowserWindow browser = BrowserWindow.Launch();
//Some Code Here
Uri uri = browser.Uri;
string st = uri.ToString();
BrowserWindow browser = BrowserWindow.Launch();
//Some Code Here
string st = browser.Uri.ToString();
The address bar of the browser contains the URL and its contents can be accessed in at least two ways:
By accessing the value of the field in the same fashion as would be done by a Coded UI assertion generated by the recorder.
By selecting the text and copying it into the clipboard. Click in the address bar, send Control-A and a Control-C characters, then just use the clipboard contents.