Show Image in Chrome extension popup - java

I'm trying to reach a point where my extension can show not only a notification that a website is updated, but also a small image that represents this update from that site. The only way I seem to get this to work is if the user has the updated page in a tab. In this case, I just reference the document.ImageSrc
img[i] = document.images[i].src;
or iFrame and it will show the first image of that page.
The problemis that an update extension that forces the user to click on the page is useless; download an extension to show updates of a page they'd have to open anyway.
Is there a way around this?
A way to show a preview of the page without being on it? Or to display the first image of a page? Or first tweet without being on twitter?
Other question wasn't answered.

Related

Creating a Re-direct Link from all links to a timed page that re-directs again - speed bump

Sorry in advanced if this is an existing topic, just couldn't locate one similar to my situation.
I have created a page for re-directing external links.
Example:
"Welcome to our business, you've clicked on an external link and will be re-directed to a website not owned by our business in 10 seconds. Please click on the back arrow link to go back, or wait to be re-directed to the external link."
It's supposed to act as a speed bump, but so far I have all external links directing to this page.
I can't figure out how to direct each link from the new page to the external link without creating a single page per external link... I don't want to do this, and I want to make it easier for anyone creating a post on the website so that they just enter about 20 characters, then add the link and it redirects them to a similar mocked page, that in turn moves the viewer to the external link they clicked on.
I also do not know how to make the page wait a few seconds before re-directing the viewer.
How can I do this? Can someone help me please?

Selenium - Clicking on a flash button which should open a new tab

I want to click on flash button which should open a new tab and in turn I need to do some operations on that page and return to the main page. Can anyone help with the code in Java? I have seen that flash doesn't work on Selenium, if so what are the alternatives?
I never tried, but i found this link, http://www.adobe.com/devnet/flash/articles/flash_selenium.html, maybe is useful for you. Is a plugin to use selenium in Flash front end

Focus issues with JWebBrowser when browser window is refocused

I am using DJBrowser in my swing application to show a static html page with style sheets.
The JWebBrowser instance is added inside the panel and the panel is inside JFrame. The issue is with focus not coming back inside the browser when the browser frame regains the focus.
I am using java 6 (jdk 1.6.0_21 to be specific).
I have tried the SimpleWebBrowserExample inside the DJProject. After opening the JWebBrowser, the focus/cursor will go inside the browser content e.g. google search text field. When the screen is de-focused by ALT+TAB and refocused using the same keys, focus does not come inside the text field again (Not sure where the focus is going).
In my application, after opening the html page in the browser user generally wants to find some words inside the page using CTRL+F option then switch between the application and browser often. But after switching to browser user cannot access CTRL+F option as there is no focus on the native browser. (Unless he/she clicks on the browser by mouse).
After reading other similar posts I have tried setting the focus to the native component like - getNativeComponent().requestFocus(), but this did not work.
Could someone please help?
I got the answer to my question above from Christopher Deckers.
If you control the web page, you could keep track of the focused control, and maybe execute Javascript code to restore focus when you detect it should re-acquire it. Javascript code could be something like:
document.getElementById("mytext").focus();
This helped me. Now the web component is getting focus when the window is focused.
Just sharing with you all.
Thanks,
Tushar

Use blackberry camera in java app to select a photo that was already on file

I know you can use
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, null);
to get the blackberry camera application to be shown and allow the user to take photos. From which you can use a FileJournalListener to find any created files.
(As shown/implied in this forum post: http://supportforums.blackberry.com/t5/Java-Development/How-to-use-FileJournalListener/td-p/295424)
There are times however, when the user chooses not to take a photo but selects one from the file system. Since this wasn't created at the time I opened it, using the FileJournalListener is not going to meet my needs.
What should I use to get the selected file?
EDIT: The functionality I'm trying to produce I've seen in the Twitter for blackberry application
I think you should create a file picker first,
http://docs.blackberry.com/en/developers/deliverables/11958/Create_a_file_picker_856986_11.jsp
After that in the application, user could select whether to capture new picture or browse from their storage.
If user select the later, open up this file picker and for every images found user can view the image, and the application can save the path where the images located for further processing.

GWT refresh cyle in development mode

I am getting a serious problem with gwt. When I am first launching the server, I am viewing the page but later when refreshing the browser, I am getting a blank page. When I do view source, I see all the required tags such nocache.js and history frame but i get a blank screen
According to me, When you refresh the page, you are not on the home page. So you replace panels on onmodulLoad on the home page, but in other pages main panels is not generated and replaced in browser.
To check my theory. Please insert a System.out.println("isLoading"); start point of onModuleLoad. Be sure In initial case "isLoading" written to console. After try to refresh page. It it isn't written you must load your homepage whenever refreshed browser.
I hope, my solution is clear.

Categories