Google Blogger - Refresh page opened in a tab from another tab - browser

Question like this has been asked in SO before, and it seems it is not possible to grab the URLs opened in other tabs.
If you write blogs, then you could have seen the Preview button, which on click opens the blog post in preview mode in a new tab and each time you clicks that button the preview page which was opened previously get refreshed.
May be my question is not constructive, but I was wondering how they are capturing the tab and refreshing the page.
What kind of stuff they are using? If anybody got the knowledge, if you share it would be very helpful.
Update:
Firebugging reveals that the Preview is a button:

Here is what Blogger uses for preview link for my post:
Preview
So what they do is use anchor tag with target attribute of a custom name (previewpost+postID).
When you first click on preview link, no tab will have this custom name, so new tab will be opened. If you click on it again, no new tab will be opened since the tab with that name already exist.
UPDATE:
Using button, this is probably accomplished the same way using javascript window.open(URL,name,specs,replace) method where name specifies the target attribute or the name of the window.

Related

How to open the default popup from context menu in a chrome extension

I have developed a chrome extension that opens a popup when I click on the icon near the address bar. Everything works fine, however I want to add some functionality to it. So I thought I'd also add a context menu item so that the user can simply search for the highlighted word. I want the popup to showup when the user clicks on the item in the context menu(the default popup in the top right corner and not a new popup window or a new tab).
Can I have this functionality? If yes, how do I implement it?
You can't make the popup page show programmatically as if the user clicked it.
However, you can still have something display based on the background script / content menu click. There are 4 main options for your background script:
Open a new tab to the popup.html page
Programmatic injection of javascript to construct a popup-like dialog on the page
Content script message passing to do the same as above, using a running content-script.
Use the notifications API for a simple minimally stylized message to the user.
Options 2, 3, 4 will allow the user to stay on their tab without any navigation. The notifications API route is the simplest to use if you just want some quick notification to the user, and there are fewer security snags. 2 and 3 require more book-keeping, but you can make the dialog look like your popup.
There should be an API for it now (as in 2023)
https://developer.chrome.com/docs/extensions/reference/action/#method-openPopup
update: tried, but failed, there was a bug.
https://github.com/GoogleChrome/developer.chrome.com/issues/2602
hope they fix it soon.
I was looking for extensions that I have already been used, but forget its name. This extension opened up the result into Context Menu, without open new TAB or popup.
may be useful
https://developer.chrome.com/extensions/contextMenus

Anyway to override/manipulate the Bookmark Page Action dialog box?

I am working on an extension that involves interacting with Chrome's bookmarks.
Is there anyway to either override the current Page Action dialog box for Bookmarks when you click on the star or is there anyway to change listing for the drop down of possible folders?
Barring that, is there a way to remove the star from the omnibar so that I can replace it with my own icon from my the extension?
No to all questions unfortunately.
The best your going to get is to add your own page action next to the default.

SharePoint 2010 Publishing Page live preview... any thoughts?

I would like to collect your ideas on the following:
SharePoint 2010 (and 2007) does have a preview button... while you are editing a publishing page you can switch to the "Page" tab and hit the Preview button:
Clicking this button does some magic to save your data, and opens a new window where the preview page is displayed. Nice, but could be better. What I would like is live update on editing of field controls from the edit page on the preview page.
My thoughts on this is are as follows:
Field types have an ID. For rendering the field values on your preview page, subclass from the standard FieldValue control, and render a span with the same ID around the field value html. So if we have the text ABC in the content editable div of a RichTextFiled X, render the field value as ABC in the display output (for example using EditModePanels for Display and Edit)
Add key-stroke event handler on all fields for the edit mode page (using for example jQuery), on key press copy contents from edit browser window to preview browser window
Transfer can be done using http://www.sfpeter.com/2008/03/13/communication-between-browser-windows-with-jquery-my-new-plugin/.
Does this sound doable? Would be great to work dual monitor, edit on one monitor, preview page in its real rendering on the other monitor. Especially if the edit mode differs from the display mode.
Looking forward to your input!
I will answer my own question. It is not as easy as its sounds. Fields can use things like reusable content and render patterns. These features render at server side, and change the output. This would require postbacks, which renders the whole thing useless. Lets stay with the already available preview button.

Drupal Panels, Tabs - How do I create a link to a tab within a panel node?

How do I create a link to a tab within a panel node?
I'm working on a Drupal website and have tabs within panel nodes (Modules: Tabs, Panels, Tabs Panel Style). When I click on the tabs it takes me to the correct tab. When I click on the 'next' and 'previous' links they take to the correct page. When I hover over those links they show me the link URL (ex: http://examplesite.com/content/Project-Template#build-it).
When I type in a URL like that in the address bar it doesn't take me to the tab, but it does take me to the main page with the tabs on it.
How do I create a link to a tab within a panel node?
This is very important b/c I want to be able to direct people to a certain tab from other pages. This will also be useful if I need to call one of the tabs but pass some parameters in this time (example: editing or deleting data, which passes parameters of what to edit or delete). I want the user to be brought back to the tab they made the request from and not the first tab b/c that is not user-friendly.
I made this for you, it's for the 7.x-1.x branch.
https://drupal.org/node/2214435#comment-8560105

prevent popup from opening new window in Ie6

I create a popup using window.open in IE6. Created popup contains a link to other page, which i want to show in the same popup window, but after clicking on the link, the target page is displayed in another brand new popup, so i have 2 popups opened at that moment.
How can i make a new page loaded in the same popup that holds a link to it?
p.s.
a href="somepage.html" target="_self"
didn't help
Using
a onclick="window.location.href = 'http://www.whatever.com/'"
is an option ?

Resources