Is it possible to navigateURL without popping up a browser - actionscript-3

I have a project that runs swf files. What i'm trying to do is to navigate to a url in that exact window without popping up a browser.
I've tried this :
navigateToURL(new URLRequest("http://www.google.com"),"_self");
but this always pops up a browser windows.
Thanks

I don't think this behaiviour is customizable. You can try to use ExternalInterface to call JavaScript funtion that will do what you need.

Related

Actionscript 3.0 Hyperlink Issue

I have created buttons that are essentially just hyperlinks to twitch.tv they work perfectly fine when I am previewing the UI via ctrl+enter within flash but when I export them to a swf when I click them nothing seems to happen... I am not sure if this is because of something I am doing when exporting them? But here is the code I have used
twitch.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
function fl_ClickToGoToWebPage(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.twitch.tv"), "_self");
}
I have tried to global security settings panel with a tutorial I found but It wouldn't allow me to link my desktop through linking the location of files, please help!
Navigate Publish Settings in Flash and select the Access network only from Local playback security option Menu. As shown in the image below.

registering browser google chrome extension for resize event

I'm new to google chrome extension development. i want to register my extension javascript to listen for the browser resize event. How can i do this ?
Currently
window.addEventListener("load",myfunction,false);
in the extension javascript was able to execute myfunction when i launch the browser
but
window.addEventListener("resize",customfunction,false);
doesnt execute customfunction on browser window resize..
How can we fix this problem ?
One thing you can try is using the following in a content script:
window.onresize = function(event) {
console.log("Resized");
};
This will log "Resized" to your console every time you resize the window. With that in mind, you can look into Message Passing, which you could use to send a message to your popup.js (or other background script) anytime the window has been resized, and then you can handle it accordingly. Also, apparently adding this functionality by way of chrome.windows.onResize is still an in-progress bug.

Is there an alternative to watir::ie.attach for watir-webdriver since attach is not supported on webdriver

I have a website which is only rendered in Webkit enabled browser (Google Chrome, Safari). I am using Google Chrome since I am on Windows 7.
I am using Watir-WebDriver to automate the same.
Issue: When I click on a button on the browser window, is launches another window and post click content is rendered in the new browser window. I need a way to be able to Identify this new browser window, in-order to be able to proceed with my testing. I have been reading on various forums, but not getting any certain answer/solution.
Q: Is there an alternative to watir::ie.attach for watir-webdriver since attach is not supported on Watir-Webdriver
Sample code:
require "rubygems"
require "watir-webdriver"
require "selenium-webdriver"
b = Watir::Browser.new(:chrome)
website = "http://xyz.com"
#a new browser is launched and the website is opened
b.goto(website)
#this opens a new browser window
b.link(:xpath,"/html/body/div/ul/li/a").click
#there is a button called "MAP" on the new browser window
b.link(:id,"btn_MAP")
#this gives an error, unknown link
"window" method is the alternative for ie.attach. Webdriver can handle the window opened by itself with window method.
b.link(:href,/server\/getPage/).click
b.window(:url,/server\/getPage/i).use do
b.link(:id,"btn_MAP").click
end
you can handle popped up windows in the window method block. If you want to keep handling popped up window, use it without block, like window(:url,/foobar/).use
see also:
http://groups.google.com/group/watir-general/browse_thread/thread/232df221602d4cfb
#Yutaka: Thanks a lot for all your help it lead me to use something like the following and it worked!
b.link(:xpath,"/html/body/div/ul/li/a").click
c = b.window(:url,"http:\/\/server\/getPage\/67\/1354")
c.use
b.link(:id,"btn_MAP").click
have you tried making the website the default homepage for the browser?
that might prevent you from having to do an attach.

Hovering over a link in a Flash file - browser highlighting

Is there any way of showing a link's destination from a swf in the browser? The answer might be a simple no.
Hard to explain, so I have attached a screenshot that makes it clearer.
Looking at http://kb2.adobe.com/cps/148/tn_14827.html , it seems possible to change the status bar of the browser from flash. As far as I know you still need to do this by hand for a button.
An other way is to use JavaScript calls from Flash (see http://naarvoren.nl/artikel/flash_en_javascript/deploy/basic_demo.html for a demo).
I guess you could use ExternalInterface to call javascript that changes the "window.status" but you would have to create a MouseEvent.MOUSE_OVER, MouseEvent.MOUSE_OUT event listeneres on every link :)

call popup.html javascript function from background page

How to call javascript function in popup.html from background page ( in chrome extensions)?
Unfortunately it is not possible to get a direct reference to the popup page, the main reason is that the page might not be open when you try and call it.
You have to use message passing to pass a message between popups and background pages.
I would ask is there a specific need to have the function in the popup and not have it re-factored into a separate shared file.
Would be best to place that functionality in a Background page instead and within your popup you can do:
var bkg = chrome.extension.getBackgroundPage()
bkg.someBackgroundPageFunction();
Thanks for the contributions. I found this reference which solved the problem.