how to get the coordinates of Browser? - firefox-addon

I have created Firefox extension using XPCOM . I want to get coordinates of client area of browser?
How to get coordinates of client area of browser using XPCOM?
please help me.
thanks,
Nandkuamar

If you have a window variable for the content area in question, just use its screenX/screenY properties.
If you have a window variable for the browser in question, use its content property to access the current tab's window, and then follow step 1.
If you don't have a variable yet, you can ask the window mediator for one.

Related

How to create a link to directly edit a SharePoint list item

I have a SharePoint online 2016 site, with a List. Now i want to have a URL (build in MS Flow) that will point directly to a specific item in Edit mode.
Meaning to have this view (both list behind and right "popup" screen):
And not like this (Copy link url)
I am able to have it opened in full screen but not like the screenshot.
Can anyone tell me if this is even possible?
I have looked into these:
http://mmkhome.blogspot.com/2010/12/sharepoint-edit-page-url-querystring.html
http://blogbaris.blogspot.com/2012/09/open-sharepoint-2010-display-edit-new.html
https://social.msdn.microsoft.com/Forums/en-US/c27e2cdd-bddb-473c-9782-0309e026204f/to-show-a-editform-in-dialog-box?forum=sharepointcustomizationprevious
https://www.spcnl.nl/redirect-link-to-item-url-from-out-microsoft-flow-to-editform-instead-of-displayform/
and tried literally everything suggested in all these links but no luck.
Things like:
Web URL/Lists/List Name/AllItems.aspx?displaymode=design
Web URL/Lists/List Name/EditForm.aspx?ID={List item ID}
/DispForm.aspx?ID=...
/EditForm.aspx?ID=...
?ID=123&pagemode=edit
?ID=123&mode=edit
PageType=4
Any suggestion is greatly appreciated!
Devtools shows that after clicking on "Edit" button above list name (the way you open this extended edit menu from first screenshoot), a REST API call is fired:
https://tenant.sharepoint.com/sites/test_site/
_api/web/GetList(%27%2Fsites%2Ftest%5Fsite%2FLists%2Ftest%5Flist%27)
/RenderExtendedListFormData(itemId=4,formId='editform',mode='2',options=15,cutoffVersion=0)
And that's it - RenderExtendedListFormData method fetch data and later, I guess, JavaScript does the rest of magic and slides out the edit menu.
To sum up: I am afriad it will be not possible using only pure URL.

How to use MenuItemExecute() with AVDoc.OpenInWindowEx()

Is it possible to use Acrobat.MenuItemExecute('Copy'); command with
AVDoc.OpenInWindowEx(FFilename, Panel1.handle, 0, True, 0,0, 2, 0, 0, 0);
in Delphi 7 and Acrobat XI Pro?
If you help me with an example I'll be glad.
I think the answer to this is probably "no" because before calling Acrobat.MenuItemExecute('Copy'), it is necessary to call BringToFront on the window containing the text you want to copy, otherwise the call to MenuItemExecute('Copy') will fail, even when the document is hosted in one of Acrobat's own windows. I don't see how you could do that successfully when the document window is hosted in your app, rather than Acrobat.
However, there are a few things you could add to your q that might assist in getting a better answer. [...]
Update Please disregard my comments in an earlier version of this answer saying that I could not reproduce the behaviour that I could not select text in the window opened using OpenInWindowEx. In fact, I can now select text fine, what I had overlooked previously is that I had set the Enabled property of my TPanel to False.
Unfortunately, I have still not been able to successfully call Acrobat.MenuItemExecute('Copy') and I am beginning to think that there is no way to do this in a hosted window. I have not found a definitive list, but various comments by Adobe staffers that google found make it clear that many MenuItemExecute strings just to not work when using OpenInWindowEx.
However that may not be the only way to retrieve the selected text back into the Delphi app.
If you look at the hosted window using a tool like WinSpy or Window Detective you will see that contained within the panel window is a whole host of Acrobat windows, including an AVL_AVView one with the Window text "AVPageView" which I imagine is the actual window displaying the PDF text.
I think the key to a possible solution is your observation, which I've confirmed, that pressing Ctrl-C in the window copies the text to the clipboard. So far I have not been able to achieve the equivalent in code, using techniques like keybd_event calls, various Delphi "SendKeys" routines and sending a WM_COPY message to the AVPageView window. I'm sure it must be possible, but I haven't yet found a way.

Does window.navigator.getGamepads() in Dart work?

Calling window.navigator.getGamepads() returns a valid list of Gamepad objects, but the axes and buttons properties are always null.
The index and ID properties are all valid though. Am I missing something or does it just not work yet?
http://api.dartlang.org/docs/bleeding_edge/dart_html/Gamepad.html
The Gamepad API works in dart, just not in the dartium browser (see Issue 15119).
If you need to use the API, either create a new browser launch, or right-click your html file and then click on 'Run as JavaScript'. Either of these solutions will launch in your standard browser.

Can I find out current typing co-ordinates in a notepad relative to desktop window

Is it possible for me to find out the typing co-ordinates (relative to desktop co-ordinates) in a notepad window from a Delphi application? For example, if we look at the below picture, I am typing on a notepad window. Can I find out the screen co-ordinates, where I am typing on notepad.
Edit
It would be helpful if someone can suggest a generic solution. Answer no1 speaks about notepad. How about a console window? Is it possible to figure out the co-ordinates, if i am typing on a console window?
I guess, if UAC would not disable it, you can implement the following sequence:
you have to learn the windows structure of the notepad. Using tools like WinSpy++, WinSight or ProcFS for Total Commander or whatever. And then you have to get the handle (HWND) of the actual editbox window. The topic of enumerating or finding other applications windows was discussed many times already on StackOverflow and on Google.
Then you have to ask the main edit window for it coordinates. See Get{Client/Window}Rect functions, see http://msdn.microsoft.com/en-us/library/windows/desktop/ms633503.aspx and http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519.aspx Perhaps even better would be to SendMessage the EM_GETRECT custom message: http://msdn.microsoft.com/en-us/library/ms997530.aspx
Then you have to know the position of caret: like TMemo.SelEnd and TEdit.SelStart - again best way would be to just read how they are implemented in VCL. Probably that would be rooted in SendMessage(EM_GETSEL,...) - http://msdn.microsoft.com/en-us/library/ms997530.aspx - there is a ready example to do this
Then you would have to ask Widows for relative coordinates of that position - relative to the Client Rect you get in above steps. See EM_POSFROMCHAR message http://msdn.microsoft.com/en-us/library/windows/desktop/bb761631.aspx and Delphi sample at http://www.delphipages.com/forum/showthread.php?t=33707
However some claims that this does not always work reliably: http://vbcity.com/forums/t/14951.aspx so as last resort you can use hard-core string parsing, as described in version 1 of this answer.

Open node in Umbraco programmatically

I have created a dashboard for an Umbraco site and I want to link from it to various node in the tree.
From what I can tell Umbraco uses editcontent.aspx?id={thenodeid} and javascript:opencontent({nodeid}).
Whenever I try to use these they always fail.
Does anyone know how to open a display a node in the Umbraco back end?
Like Tim Saunders said you really just need to target the correct iframe. The openContent function looks like this:
function openContent(id) {
parent.right.document.location.href = 'editContent.aspx?id=' + id;
}
So you need to target the 'right' iframe.
I've tested editContent.aspx?id=1234 on my Umbraco installation and it seems to work correctly.
I'm assuming you are replacing {thenodeid} with the actual node id you want?
Umbraco uses iFrames in the backend for the content tree and the content areas etc. This means that you do not always have full access to the Javascript libraries from the frame that you are in.
Therefore you may need to either include the library in the page you are working with or try and reference the method calls by walking up the dom.
I can't find any documentation for this so it may be a case of looking at the HTML source and working out what is going on.

Resources