summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/content_script_apitest.cc
Commit message (Collapse)AuthorAgeFilesLines
* [Extensions] Fix improper extension tab ownership bugrdevlin.cronin2015-07-101-0/+49
| | | | | | | | | | | | | | | An extension can "own" a tab if it owns the main frame, and we block content scripts in this case. But there was a race that meant the tab wasn't being updated in time for document_start. Instead of informing the tab of its owner across IPC, use the security origin of the top frame, since this can now be accessed from remote frames as well. BUG=507461 Review URL: https://codereview.chromium.org/1225413002 Cr-Commit-Position: refs/heads/master@{#338300}
* GURL::Replacements methods accept a StringPiece instead of std::string&.mgiuca2015-02-051-2/+1
| | | | | | | | | | | | | | | | | | | | | Previously, it was unsafe to pass a char* because it would be implicitly converted to a string with a very short lifetime. Now, you can safely pass a char* as long as the memory pointed to by the char* outlives the Replacements (which is always true for string literals). All existing usage of Replacements should continue to work as usual. Updated every call to Replacements Set*Str methods that that could be simplified by the new StringPiece API (for example, passing string literals directly, instead of copying them into a string object). Internally, renamed StdStringReplacements to StringPieceReplacements. BUG=454274 Review URL: https://codereview.chromium.org/889463003 Cr-Commit-Position: refs/heads/master@{#314771}
* [Extensions] Fix content script injection for blocking scriptsrdevlin.cronin2014-12-111-0/+281
| | | | | | | | | | | Ensure that if a content script has blocking code (such as a javascript alert), we don't try to continue injecting scripts. BUG=431263 Review URL: https://codereview.chromium.org/792913002 Cr-Commit-Position: refs/heads/master@{#307932}
* Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}.thestig2014-10-311-1/+1
| | | | | | | | Fix lint errors along the way. Review URL: https://codereview.chromium.org/635573005 Cr-Commit-Position: refs/heads/master@{#302318}
* Standardize usage of virtual/override/final in chrome/browser/extensions/dcheng2014-10-211-1/+1
| | | | | | | | | | | | This patch was automatically generated by applying clang fixit hints generated by the plugin to the source tree. BUG=417463 TBR=mek@chromium.org Review URL: https://codereview.chromium.org/666153002 Cr-Commit-Position: refs/heads/master@{#300474}
* replace OVERRIDE and FINAL with override and final in chrome/browser/extensions/mostynb2014-10-041-1/+1
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/624153002 Cr-Commit-Position: refs/heads/master@{#298134}
* Use extensions::ResultCatcher; delete ExtensionApiTest::ResultCatcher.yoz2014-09-091-0/+1
| | | | | | | | BUG=388893 Review URL: https://codereview.chromium.org/555633003 Cr-Commit-Position: refs/heads/master@{#294031}
* Move extension notifications to extensions/browser/notification_types.hjamescook@chromium.org2014-07-311-2/+2
| | | | | | | | | | | | | | | | | | As part of the extensions module refactor we temporarily allowed the use of chrome_notification_types.h in src/extensions. However, this allowed code moving into src/extensions to listen to notifications from Chrome, which was a layering violation. This CL moves all the extensions notifications into their own header and cleans up DEPS to disallow the exception. BUG=392622 TEST=compiles, unit_tests, browser_tests, extensions_unittests TBR=miket@chromium.org for apps/ Review URL: https://codereview.chromium.org/425303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286770 0039d316-1c4b-4281-b951-d872f2087c98
* Allow content script insertion on about:-URLs.rob@robwu.nl2014-05-151-0/+12
| | | | | | | | | | | | | | Adds a new key content_scripts[*].match_about_blank and InjectionDetails.matchAboutBlank. If true, content scripts will also be inserted in about:* frames provided that its origin matches a pattern in the extension permissions. BUG=76429,55084,146789 TEST=browser_tests: ExtensionApiTest.ContentScriptAboutBlank*:ScriptContextTest.GetEffectiveDocumentURL Review URL: https://codereview.chromium.org/226663003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270690 0039d316-1c4b-4281-b951-d872f2087c98
* Make css injected on a per-document basis so we can use PermissionsData checksrdevlin.cronin@chromium.org2014-04-081-0/+102
| | | | | | | | | | | | | | Move CSS injection into InjectScripts() so that we use the same tests for - PermissionsData::CanExecuteScriptOnPage() - Exclude/Include matches Also add a test, because it doesn't look like we had any. BUG=356652 Review URL: https://codereview.chromium.org/224993002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262316 0039d316-1c4b-4281-b951-d872f2087c98
* Move Extension and PermissionsData to extensions/common.yoz@chromium.org2013-11-151-1/+1
| | | | | | | | | | BUG=298586 R=cdn@chromium.org, miket@chromium.org, sky@chromium.org TBR=cdn@chromium.org Review URL: https://codereview.chromium.org/15239002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235462 0039d316-1c4b-4281-b951-d872f2087c98
* Update some includes of chrome_notification_types.hjam@chromium.org2013-07-121-1/+1
| | | | | | | | TBR=brettw Review URL: https://codereview.chromium.org/19074002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211285 0039d316-1c4b-4281-b951-d872f2087c98
* chrome/browser: Migrate from googleurl/ includes to url/ ones. Part 2tfarina@chromium.org2013-07-031-1/+1
| | | | | | | | | BUG=229660 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/18251003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210050 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1phajdan.jr@chromium.org2013-06-261-16/+21
| | | | | | | | | | | | This eliminates a whole class of problems with SpawnedTestServer failing to start. BUG=96594, 98194 R=asargent@chromium.org, rsleevi@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/16268017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208784 0039d316-1c4b-4281-b951-d872f2087c98
* Remove ContentScriptInjectedIntoMultipartPage test, as we no longer support ↵senorblanco@chromium.org2013-06-131-13/+0
| | | | | | | | | | multipart pages. R=aa@chromium.org, abarth@chromium.org Review URL: https://codereview.chromium.org/17002003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206153 0039d316-1c4b-4281-b951-d872f2087c98
* Disable ExtensionApiTest.ContentScriptPermissionsApi on Windowshashimoto@chromium.org2013-06-111-1/+7
| | | | | | | | | BUG=248418 TBR=kinaba@chromium.org Review URL: https://codereview.chromium.org/16625014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205385 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of utf_string_conversions.h in chrome/browser/, part 2.avi@chromium.org2013-06-071-1/+1
| | | | | | | | | | BUG=none TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/16561007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204977 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the optional_permission_set, required_permission_set, and ↵rdevlin.cronin@chromium.org2013-05-091-2/+2
| | | | | | | | | | | | | initial_api_permissions members from Extension, replacing them with a PermissionsData class. Also move PermissionsAPI to extensions namespace. BUG=159265 TBR=ben@chromium.org (gypi) Review URL: https://chromiumcodereview.appspot.com/14509002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199114 0039d316-1c4b-4281-b951-d872f2087c98
* net: move host_resolver files from net/base to net/dnsphajdan.jr@chromium.org2013-03-211-1/+1
| | | | | | | | BUG=70818 Review URL: https://codereview.chromium.org/12518036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189485 0039d316-1c4b-4281-b951-d872f2087c98
* Remove TabStripModel wrapper use.avi@chromium.org2013-01-291-2/+2
| | | | | | | | | | BUG=167548 TEST=no functional change Review URL: https://chromiumcodereview.appspot.com/12066003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179254 0039d316-1c4b-4281-b951-d872f2087c98
* Run the JSON Schema Compiler's bundle compilation on JSON files. Previously itkalman@chromium.org2013-01-111-2/+2
| | | | | | | | | | | | | was only run on IDL files. Clean up all the code which that simplifies. TBR=isherman@chromium.org,battre@chromium.org,akalin@chromium.org BUG=141318 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=176015 Review URL: https://codereview.chromium.org/11747025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176236 0039d316-1c4b-4281-b951-d872f2087c98
* Revert revision 176015ricow@chromium.org2013-01-101-2/+2
| | | | | | | | | | | | | | | | | This is a manual revert, drover did not like the deleted files > Run the JSON Schema Compiler's bundle compilation on JSON files. Previously it > was only run on IDL files. Clean up all the code which that simplifies. > > TBR=isherman@chromium.org,battre@chromium.org,akalin@chromium.org > BUG=141318 > > Review URL: https://chromiumcodereview.appspot.com/11747025 TBR=isherman@chromium.org,battre@chromium.org,akalin@chromium.org Review URL: https://codereview.chromium.org/11778097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176054 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 176047ricow@chromium.org2013-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | > Revert 176015 > > Run the JSON Schema Compiler's bundle compilation on JSON files. Previously it > > was only run on IDL files. Clean up all the code which that simplifies. > > > > TBR=isherman@chromium.org,battre@chromium.org,akalin@chromium.org > > BUG=141318 > > > > Review URL: https://chromiumcodereview.appspot.com/11747025 > > This seems to be causing complation failures on release win builders: > http://chromegw/i/chromium.chrome/builders/Google%20Chrome%20Win/builds/15702 > > TBR=kalman@chromium.org > Review URL: https://codereview.chromium.org/11826048 Drover messed up this revert, reverting it TBR=ricow@chromium.org Review URL: https://codereview.chromium.org/11778096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176051 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 176015ricow@chromium.org2013-01-101-2/+2
| | | | | | | | | | | | | | | | | | > Run the JSON Schema Compiler's bundle compilation on JSON files. Previously it > was only run on IDL files. Clean up all the code which that simplifies. > > TBR=isherman@chromium.org,battre@chromium.org,akalin@chromium.org > BUG=141318 > > Review URL: https://chromiumcodereview.appspot.com/11747025 This seems to be causing complation failures on release win builders: http://chromegw/i/chromium.chrome/builders/Google%20Chrome%20Win/builds/15702 TBR=kalman@chromium.org Review URL: https://codereview.chromium.org/11826048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176047 0039d316-1c4b-4281-b951-d872f2087c98
* Run the JSON Schema Compiler's bundle compilation on JSON files. Previously itkalman@chromium.org2013-01-101-2/+2
| | | | | | | | | | | was only run on IDL files. Clean up all the code which that simplifies. TBR=isherman@chromium.org,battre@chromium.org,akalin@chromium.org BUG=141318 Review URL: https://chromiumcodereview.appspot.com/11747025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176015 0039d316-1c4b-4281-b951-d872f2087c98
* Simplify ExecuteJavaScript* functions.darin@chromium.org2013-01-041-3/+2
| | | | | | | | | | | | | | | | | | | | Remove the "Java" and rename to ExecuteScript*. This better matches conventions elsewhere in the codebase. Introduce ExecuteScriptInFrame* variants for the less common case where script execution in a subframe is desired. Make it possible to pass the ExecuteScript* family of functions either a WebContents pointer or a RenderViewHost pointer to further simplify callsites. R=jam@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/11753009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175156 0039d316-1c4b-4281-b951-d872f2087c98
* Change ExecuteJavaScript* helper functions in browser_test_utils.{h,cc}darin@chromium.org2013-01-021-4/+5
| | | | | | | | | | | | | to take std::string (UTF-8) instead of std::wstring. This seems to help simplify callsites considerably. TBR=jam@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/11728003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174880 0039d316-1c4b-4281-b951-d872f2087c98
* Disable ExtensionApiTest.ContentScriptIsolatedWorlds; it times on Linux ↵bauerb@chromium.org2012-11-281-1/+7
| | | | | | | | | | | | Precise x64 out after a JS exception. BUG=163097 TBR=aa@chromium.org NOTRY=true Review URL: https://codereview.chromium.org/11411222 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169915 0039d316-1c4b-4281-b951-d872f2087c98
* Re-enable failing extension CSS injection browser_tests.tony@chromium.org2012-11-261-3/+1
| | | | | | | | | | | | | | | | | Change the code in ExtensionApiTest.ContentScriptCSSLocalization to no longer use window.getMatchedCSSRules. After WebKit r135082, getMatchedCSSRules no longer matches style rules added by insertCSS. Re-enable ExecuteScriptApiTest.ExecuteScriptBasic and ExecuteScriptApiTest.ExecuteScriptInFrame. They were hitting an ASSERT in WebKit which got fixed in r135316. BUG=162061 Review URL: https://chromiumcodereview.appspot.com/11308143 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169517 0039d316-1c4b-4281-b951-d872f2087c98
* Pass extensions' Content Security Policy to WebKit when using isolated worlds.mkwst@chromium.org2012-11-211-0/+5
| | | | | | | | | | | | | | | | | | | | http://webkit.org/b/97398 added the ability for script in an isolated world to bypass the main world's Content Security Policy by setting a new policy on the isolated world. This new policy is not yet enforced, but that's the end goal. This CL uses the new API methods that landed in that WebKit patch to associate a policy with the isolated world created for extensions' content scripts. This should allow extensions free reign on a website, regardless of it's defined CSP. A future patch on the WebKit side will allow the isolated world to enforce the CSP that's passed in, which will give extensions a clearly understandable policy that's the same everywhere. BUG=158716 Review URL: https://chromiumcodereview.appspot.com/11366003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169071 0039d316-1c4b-4281-b951-d872f2087c98
* WebKit roll 135046:135094jianli@chromium.org2012-11-191-1/+4
| | | | | | | | | | BUG=none TEST=none TBR=yurys@chromium.org Review URL: https://codereview.chromium.org/11420068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168586 0039d316-1c4b-4281-b951-d872f2087c98
* Added check to prevent extensions from injecting scrips into pages hosted in ↵zelidrag@chromium.org2012-08-231-0/+13
| | | | | | | | | | | iframe context of other extensions (other than itself). BUG=126257 TEST=ExtensionApiTest.ContentScriptOtherExtensions, added new checks to ExtensionScriptAndCaptureVisibleTest.Permissions Review URL: https://chromiumcodereview.appspot.com/10863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152955 0039d316-1c4b-4281-b951-d872f2087c98
* Move ExecuteJavaScript functions from ui_test_utils.h to ↵jam@chromium.org2012-07-241-1/+2
| | | | | | | | | browser_test_utils.h so they can be reused by content_browsertests. BUG=90448 Review URL: https://chromiumcodereview.appspot.com/10795090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148132 0039d316-1c4b-4281-b951-d872f2087c98
* Create content\public\test\test_utils.h to hold common test classes that are ↵jam@chromium.org2012-07-201-1/+1
| | | | | | | | | used by unit and browser tests. unit tests shouldn't be including ui_test_utils.h. BUG=90448 Review URL: https://chromiumcodereview.appspot.com/10807047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147602 0039d316-1c4b-4281-b951-d872f2087c98
* Expose the extension/app's id on chrome.runtime.id and, and make thiskalman@chromium.org2012-07-051-2/+0
| | | | | | | | | | an unprivileged API (opening it up to content scripts) along with getManifest, getURL, and lastError on chrome.runtime. Review URL: https://chromiumcodereview.appspot.com/10640013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145505 0039d316-1c4b-4281-b951-d872f2087c98
* Move tab functions off Browser into browser_tabstrip and browser_tabrestore.ben@chromium.org2012-06-291-1/+2
| | | | | | | | http://crbug.com/133576 TEST=none Review URL: https://chromiumcodereview.appspot.com/10702029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145015 0039d316-1c4b-4281-b951-d872f2087c98
* Disable test for now as flakiness was observed on all platforms.kbr@chromium.org2012-06-231-6/+2
| | | | | | | | | | | BUG=120762 TEST=compiled TBR=mihaip Review URL: https://chromiumcodereview.appspot.com/10666008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143758 0039d316-1c4b-4281-b951-d872f2087c98
* TabContentsWrapper -> TabContents, part 12.avi@chromium.org2012-06-121-1/+1
| | | | | | | | | | | | Extensions. BUG=131026 TEST=no change Review URL: https://chromiumcodereview.appspot.com/10535077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141590 0039d316-1c4b-4281-b951-d872f2087c98
* Move Extension into extensions namespaceaa@chromium.org2012-05-211-1/+1
| | | | | | | | | BUG=117262 TBR=aa@chromium.org Review URL: https://chromiumcodereview.appspot.com/10375021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138074 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the optional permissions API.jstritar@chromium.org2012-04-131-0/+9
| | | | | | | | | | | | Make sure the Extension copies in the renderers have the active permissions and not just those defined in the manifest. BUG=123250 TEST=ExtensionApiTest.ContentScriptPermissionsApi Review URL: http://codereview.chromium.org/10073011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132289 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 131261 - Disable moar tests whose code is missing on beta.aa@chromium.org2012-04-071-1/+1
| | | | | | | | | | | TBR=yoz@chromium.org Review URL: https://chromiumcodereview.appspot.com/10022012 TBR=aa@chromium.org Review URL: https://chromiumcodereview.appspot.com/10023010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131263 0039d316-1c4b-4281-b951-d872f2087c98
* Disable moar tests whose code is missing on beta.aa@chromium.org2012-04-071-1/+1
| | | | | | | | TBR=yoz@chromium.org Review URL: https://chromiumcodereview.appspot.com/10022012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131261 0039d316-1c4b-4281-b951-d872f2087c98
* Mark flaky test as flaky.abodenha@google.com2012-03-281-1/+7
| | | | | | | | | BUG=120762 TEST=None Review URL: https://chromiumcodereview.appspot.com/9885001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129494 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most of Browser::GetSelectedTabContents calls into ↵jam@chromium.org2012-01-031-2/+2
| | | | | | | | | | | | Browser::GetSelectedWebContents. I've converted the easy ones, I'll do the ones with more dependencies in a separate change to keep things trivial to review. I considered taking out GetSelectedTabContents altogether and having people just use GetSelectedTabContentsWrapper()->web_contents() per the existing comment in browser.h, but there are a lot of callers and it seemed too long to type. BUG=98716 TBR=joi Review URL: http://codereview.chromium.org/9015022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116122 0039d316-1c4b-4281-b951-d872f2087c98
* Rename TabContents::render_view_host() to GetRenderViewHost and put it into ↵jam@chromium.org2011-12-201-1/+1
| | | | | | | | | the WebContents interface. BUG=98716 Review URL: http://codereview.chromium.org/9007026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115200 0039d316-1c4b-4281-b951-d872f2087c98
* Enable content scripts to receive extension API events.aa@chromium.org2011-11-171-1/+19
| | | | | | | | | BUG=80308 Review URL: http://codereview.chromium.org/8585005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110472 0039d316-1c4b-4281-b951-d872f2087c98
* Enable extension APIs for content scripts.aa@chromium.org2011-11-121-0/+9
| | | | | | | | | | | This only enables extension functions. I will do events in a separate change. BUG=81760,80308 Review URL: http://codereview.chromium.org/8540012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109812 0039d316-1c4b-4281-b951-d872f2087c98
* Move NotificationObserver, NotificationSource, and NotificationDetails to ↵jam@chromium.org2011-10-191-1/+1
| | | | | | | | | | | content/public/browser. This patch got way bigger than I wanted, but once I moved NotificationDetails, I figured I might as well mvoe the others since they're in the same files. In hindsight, I should have converted a subset of files at a time by leaving a using statement in the header. BUG=98716 TBR=joi git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106196 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a crash when loading a multipart html page.tony@chromium.org2011-09-271-1/+15
| | | | | | | | | | | | | When loading a multipart page, the load hasn't been committed yet so dataSource() is NULL. In that case, use the provisionalDataSource(). BUG=97592 TEST=covered by browser_tests Review URL: http://codereview.chromium.org/8044003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103027 0039d316-1c4b-4281-b951-d872f2087c98
* Added code for localizing scripts CSS before injection takes place.adriansc@google.com2011-08-231-0/+5
| | | | | | | | | | | | BUG=39899 TEST=browser_tests:ExtensionApiTest.ContentScriptCSSLocalization Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97365 Review URL: http://codereview.chromium.org/7552028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97927 0039d316-1c4b-4281-b951-d872f2087c98