insert content from firefox webextension - firefox-addon

I created a simple Firefox extension to show an external page in a popup. I was now wondering if it's possible to use the content from the external page to fill a field in the current tab or if this is only possible when loading the content natively.
Basically what I'm trying to do is:
Open a webpage
The webpage contains an input field
Open the extension > popup appears
Click an item inside the popup
Use the content of the item clicked as value for a (or all) input fields in the current tab

Related

set programmatically focus when new content is loaded on iOS

I'm trying to set up automatically focus on first loaded article. (f.e. user clicks on the button "load more" and new articles are loaded).
My react implementation:
I'm using ref attribute in <Link> component, which is from react-router library and then I'm calling focus() method in lifecycle method componentDidMount().
It works on all devices except iOS. If I turn on voiceover on iphone and then on webpage I click on the button, it doesn't automatically focus on first loaded article). It works just with html anchor tag.
I read some articles before and it looks that it's not possible to do this in this way but only with firing some event f.e. click event.
Can someone confirm that it's not possible to solve it in this way or there is any workaround without using jquery ?

open popup through Link in Vaadin

I am Using Vaadin Framework in my application. I want to open a popup screen using Vaadin Link. I know to open popup thrugh button but I need to open popup through Link. Can anybody help, this is my code:
Link link1 = new Link(String.valueOf(rs.getInt(1)), new ExternalResource("#"));
_reportTable.getItem(dashboardDataRowId)
.getItemProperty("todo").setValue(link1);
As explained in in Book of Vaadin - Components - Link, Link should be used only for hyperlinks to external resources, as it is nothing more than a wrapper for a anchor html tag and as such it does not fire any server side events. As a result you cannot react on server side to open a popup window or do some other logic.
The Link is a regular HTML hyperlink, that is, an anchor
element that is handled natively by the browser. Unlike when clicking
a Button, clicking a Link does not cause an event on the server-side.
What you really want is vaadin button styled as a hyperlink. You can do it by creating a regular button (which supoorts server side events and can open your popup) and then adding an appropriate style.
Button linkButton = new Button();
linkButton .setStyleName(BaseTheme.BUTTON_LINK);
Always be sure to call addStyleName() instead of setStyleName() as it only adds your new style to the list of other styles already present and it does not override that list with your only new style.

printing a report in a navigation subform

I have built a database using MS Access 2010, everything is done except for one button that is not working.
I have a main navigation form, that has different tabs, one tab opens another navigation form (secondary nav. form - SNF) inside the main navigation form (MNF). in the SNF there are tabs which open reports that get their data from queries.
the reports, when opened separately, have a print button which works fine when the report are opened directly and not using the forms.
when the reports are opened through the SNF and the print button pressed the printed page has the SNF and the MNF headers and footers which isn't needed and the supposedly 1 page report would be divided to 4 pages. each containing a quarter of the view.
what I am trying to do is have the printing function using the button print only the report inside the SNF without anything outside that reports borders just as it does when the report is opened directly without using the forms.
NOTE:
* The printing button uses the defaut access print function which is implemented using the button wizard.
** Attached is a screenshot of what I get in both cases.
I was having the same issues, where the entire form was being printed instead of the reports that were navigation subforms. I worked around it this way:
VBA:
DoCmd.OpenReport "MY REPORT", acViewPreview
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "MY REPORT"
It's clumsy, but it allows the user to use the print dialogue instead of just using
DoCmd.OpenReport, "MY REPORT", acPrint
and not being given the option choosing a printer, double sided etc.

How to overlay an XUL file from another extension in a bootstrapped add-on (or otherwise modify the DOM of the XUL file)?

I want to add some DOM elements to another extension's XUL file.
That extension allows itself to be "opened" by clicking on a toolbar button that it adds to Firefox. Clicking on this button opens a new tab with the chrome address of an XUL file that is part of the extension.
I have already created some DOM elements dynamically and added them to elements on the Firefox window (e.g. the previously mentioned toolbar) by both adding them when my add-on is loaded and using window "load" event listeners for windows opened after my add-on is loaded (using document.createElement() and element.appendChild()), but I am not sure about the best way to add dynamic elements to this XUL file that can be opened and closed multiple times in the same window.
Is there any way to overlay the XUL file one time per session (I am guessing not)? Otherwise, do I need to set up some kind of page load listener that fires every time a page loads and then checks the address to see if it matches the XUL file's address and does the overlay if so? Is it possible to listen for a specific address?
I ended up adding a load listener to gBrowser to listen for page loads. The listener checks event.originalTarget.location for the chrome XUL file address and adds the DOM elements on a match. When my add-on is enabled, I use gBrowser.browsers.length and gBrowser.getBrowserAtIndex() to loop through all open tabs in a window to check if the XUL is already open.
For clean up, I store a reference to each DOM element added to the XUL file in a addedByMyAddon array property that I add to the tab's content document. When my add-on is disabled, I loop through the open tabs again looking the for the XUL file and then delete everything in the addedByMyAddon property and then delete the addedByMyAddon property.

How to print the content of popup only?

I have a page doing some functionality and at the end it produces a report displayed in a popup and I want to print this report only not the whole page.
How can I print the the content of the popup?
Popup embeded into the page and there is no way to print only part of the page.
So you have to create separate page (which you can generate from the popup content) or use an iframe.

Resources