Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I select some text on page, displayed in the Chrome web-browser, and click with my right button, context menu opens. It has three options: "Copy", "Search %YOUR.SEARCH.ENGINE.NAME for '%SELECTED.TEXT%" and "Print..."; then is has separator and "Inspect Element".

My usual usage of popup menu on selected text is to use "Search %% for '%%'", but sometimes I miss the right menu item and clicks on "Print...". Then print preview opens (or OS print dialog if --disable-print-preview command-line option was added. I have no printer, and I need not to print one or two words, I just want

Is it possible to disable "Print..." item in the Google's version of Chrome?

If it is not possible, how can I find the code to display "Print..." in Chromium?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Printing can be disabled completely by setting:

"printing": {
   "enabled": false
},

to the Preferences file. Internally this sets kPrintingEnabled.

share|improve this answer
    
So, it is possible to do binary patch of compiled render_view_context_menu.cc's function RenderViewContextMenu::AppendPluginItems / AppendPageItems / AppendPrintItem? I think the needed code path is only in AppendPrintItem –  osgx Mar 15 at 2:20
    
There is profile_->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) code in AppendPrintItem. Is it possible to globally set kPrintingEnabled flag to false? How? –  osgx Mar 15 at 2:27
    
This way: Open the profile folder, find the JSON file Preferences, find "printing" field (browser->extensions->printing), then add , "enabled": false into it. Dan D, Thank you for digging into the code, the keys was found via query on codesearch.debian.net "kPrintingEnabled" in src/chrome/common/pref_names.cc (Boolean controlling whether printing is enabled. const char kPrintingEnabled[] = "printing.enabled";), after checking the RenderViewContextMenu::AppendPrintItem function. Please update your answer with JSON edit method. –  osgx Mar 15 at 2:34
1  
Ok, I cleaned up the question to the solution. The rest if need is in the revision history. –  Dan D. Mar 15 at 2:39
    
Yes, it is in the top section, my comment about "browser->extensions" was wrong. –  osgx Mar 15 at 2:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.