Can a Google Chrome tab id ever be zero? - google-chrome-extension

Every tab in google chrome has an id that is unique for that browsing session, even across windows. The id is automatically assigned by chrome's internals when you call chrome.tabs.create(). Can this value ever be set to zero?
My reason for this question is that I would like to do a boolean test based on the id and I need a truthy value when there is an id.

No, tab IDs start at 1 and go up from there (they're stored as SessionID instances). -1 may also be returned in some cases.

Related

basic blue prism email login object

Trying to learn basic blue prism.
I have made an object to login to my gmail account.
It enters the page where mail id has to be entered. The email id gets entered and the next page appears where the password has to be entered. But in the writer tool it shows the following message : "Internal : Failed to perform step 1 in Write Stage 'Writer2' on page 'Initialise' - No elements match the supplied query terms"
I looked into all the most obvious bugs and I cant find anything wrong. Can someone please give any suggestions as to what the problem could be?
The specific error message you're getting indicates there's an issue with your spying of the element you're attempting a Write on.
Without knowing anything else about the way you've included/excluded certain attributes of the element you're attempting to write to, the only sound advice one could offer would be to open the Application Modeler and trial-and-error the "Match?" for each attribute until you're able to use the "Highlight" button and verify a single interface element is selected. (Usually in circumstances such as yours, the "Value" attribute of the element you've spied has its Match checkbox selected, but the value has changed since spying it, thus making it not a match.)
check if the data item you are storing the password in is of password type.
You can reset the password by going ahead with the "write" property and delete once and drag-drop again at the same place and click OK. reset the flowchart and run them again, you'll not get the error. I had faced the same issue earlier and got fixed.
It sometimes happens due to the slowness of your internet connection BP not able to read the data item info and directly moved to next steps, to fix it, you can use wait functionality and give the 8-10 sec of wait time.
Hope this helps.
stay blessed!
When spying a browser please make sure you are using HTML mode to capture the necessary Element (please note that BP only supports IE, so no Chrome or other browser!). Also, please remember that the browser page you are spying has to be launched from the Application Modeller in order to be "attached" by BP.
To cycle between modes, simply hit the Alt key after clicking "Identify" on the Application Modeller. After you have captured the correct area of the page where your password goes, uncheck all the attributes of the element that are blank and also the URL attribute (you should be left with 4 maybe 5 atributes left), then hit "Apply" and "OK". Click "Highlight" to make sure BP still finds the element of the page that you want. Then in your Process or Object canvas, use a "Write" stage and drop this element you just created in the Element field, and the password into the Value field (the value has to be between "" unless you are using a data item instead of typing it in). If you have done all this, the "Write" stage should most definitely enter the password into the password field. Good luck!

Primefaces SelectOneMenu, selection on filter

A user of one of my applications has observed a strange behaviour of the selectOneMenu of Primefaces when using filters.
I have a mask with some fields, some of them are selectOneMenues. I deliver values via a map of Strings and use a filter on them, so the user can search for specific values, in this case currencies.
I have set a default value for this field (as the value in the object behind this field).
So, imagine the following case:
User opens the mask - default value is set on the selectOneMenues
User klicks the arrow on the field and opens the list of available values
he types in some characters and a result is returned (he finds various values with it)
when this happens, in the field, the first value from the result list is set automatically
when the user now selects a random entry, it is set and everything is fine
if the user instead decides he want's the default value back he could either click somewhere on the mask and the value is resetted -> works fine
or he could decide to click on the original value, which was set as default before, in this case the selected value doesn't change but stays the first result from the filter
when now saving the entity behind the form, the original default value is saved
I assume that this happens because when the first result from the filter is set, it just set in the frontend and not in the entity behind the form/ the backend.
Is this a known bug? Do you have any idea how to fix it with a reasonable amount of effort?
I will try to convince my customer to accept this behavior, but I think it's a bit strange, although I admit this is a scenario that's not likely to happen, often. Nevertheless, they found it =)
I am using Primefaces version 5.3.11 (elite version or something like that)

How can I uniquely identify a chromecast chrome sender?

When casting a tab from chrome, the receiver registers a new sender with an id like this:
18:client-69832
However, when the chrome tab is reloaded, a call to castReceiverManager.getSenders() now contains two entries and continues to increase every time the page is reloaded
castReceiverManager.getSenders() -> 18:client-69832
RELOAD
castReceiverManager.getSenders() -> 18:client-69832, 18:client-78542
RELOAD
castReceiverManager.getSenders() -> 18:client-69832, 18:client-78542, 18:client-84557
etc...
The first part 18:client seems to remain consistent across reloads. Can we rely on this to uniquely identify the device? If not, how can we uniquely identify the device?
When you say unique, what is the scope that you have in mind If you are looking for something that persists between sessions, then that number s not unique. If you want something unique across sessions, one approach is to have each sender create such uid and communicate that to the receiver (if receiver needs to know).

chrome extension what's the use of argument: tabld?

I'm learning how to write a chrome extension.
in most of the apis, there is a argument: tabld.
I can't understand what is it used for.
for example ,function chrome.browserAction.setIcon's description is here
I searched all over the internet and chrome extension documents, there is not even a example there, just a sample describe said:
tabId ( optional integer ) Limits the change to when a particular tab
is selected. Automatically resets when the tab is closed.
what this argument used for? can anyone give me a example of it ?
Best regards
Each tab in Chrome has unique ID which resets after browser restart. It is useful when you want to identify tabs.
In 99% cases you will be interested only in currently selected tab because it is where a user is right now. You can just pass null instead of tabId to almost any method and it would mean you want selected tab id. Same with window id - passing null usually means current window.
Otherwise you can get selected tab with chrome.tabs.getSelected, which returns tab object containing id. You can get all tabs with their ids with chrome.tabs.getAllInWindow.

Method to find Chrome Bookmarks next available ID number?

Anyone know how to get the next index number available for a Chrome bookmark? The closest I can come right now is pulling the ID of the most recently added and increasing by 1. That works until a user creates a bookmark and immediately deletes it. Then, the id index increases by 1 but most recent returns the most recent bookmark still existing and the number is incorrect.
For bookmarks created in your extension you can use the callback of chrome.bookmarks.create which returns a BookmarkTreeNode (that contains the attribute id).
For bookmarks created by the user outside of your extension (and in your extension) you can listen to chrome.bookmarks.onCreated which will both return a string id and a BookmarkTreeNode.
To get the first id (eg: the first time the extension runs) you could create a bookmark, get the id and then delete it. This might not be needed if you just want to link metadata to bookmarks, the onCreated event should be enough.

Resources