Here is a solution how to find if page has been opened in service console.
It can be also used to pass any parameters from javascript to apex controller.


<apex:page controller="MyController" sidebar="false" docType="html-5.0">
    <apex:includeScript value="/soap/ajax/34.0/connection.js"/>
    <apex:includeScript value="/support/console/34.0/integration.js"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery, '/jquery.min.js')}" />

        $j = jQuery.noConflict();
        $j(document).ready(function() {  
        // Set cosole value in hidden field
        function setConsoleStatus() {
            inConsole = sforce.console.isInConsole();
    <apex:form >
        <apex:inputHidden id="ConsoleStatus" value="{!pageInConsole}" />
        <apex:pageBlock id="theBlock" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton value="TestConsole" action="{!inConsole}" rendered="true"/>


public with sharing class MyController {
    public Boolean pageInConsole {get; set;}

    public pageReference inConsole() {
        ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'In console value:' + pageInConsole));
        return null;


© Paweł Woźniak